X-Git-Url: http://git.rohieb.name/openwrt.git/blobdiff_plain/ac2d02c3e08c4c3d62859bffb4dd3bb891b3d5c6..071298ef7069c0fda08a97a8a8e258c6dc0af269:/package/busybox/patches/340-lock_util.patch?ds=inline diff --git a/package/busybox/patches/340-lock_util.patch b/package/busybox/patches/340-lock_util.patch index d946f3229..fd657b698 100644 --- a/package/busybox/patches/340-lock_util.patch +++ b/package/busybox/patches/340-lock_util.patch @@ -1,43 +1,30 @@ ---- a/include/applets.h -+++ b/include/applets.h -@@ -220,6 +220,7 @@ - USE_LOAD_POLICY(APPLET(load_policy, _BB_DIR_USR_SBIN, _BB_SUID_NEVER)) - USE_LOADFONT(APPLET(loadfont, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) - USE_LOADKMAP(APPLET(loadkmap, _BB_DIR_SBIN, _BB_SUID_NEVER)) -+USE_LOCK(APPLET(lock, _BB_DIR_BIN, _BB_SUID_NEVER)) - USE_LOGGER(APPLET(logger, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) - USE_LOGIN(APPLET(login, _BB_DIR_BIN, _BB_SUID_ALWAYS)) - USE_LOGNAME(APPLET_NOFORK(logname, logname, _BB_DIR_USR_BIN, _BB_SUID_NEVER, logname)) ---- a/include/usage.h -+++ b/include/usage.h -@@ -2138,6 +2138,9 @@ - #define loadkmap_example_usage \ - "$ loadkmap < /etc/i18n/lang-keymap\n" - -+#define lock_trivial_usage NOUSAGE_STR -+#define lock_full_usage "" -+ - #define logger_trivial_usage \ - "[OPTION]... [MESSAGE]" - #define logger_full_usage "\n\n" \ ---- a/miscutils/Config.in -+++ b/miscutils/Config.in -@@ -364,6 +364,12 @@ +--- a/include/applets.src.h ++++ b/include/applets.src.h +@@ -218,6 +218,7 @@ IF_LN(APPLET_NOEXEC(ln, ln, BB_DIR_BIN, + IF_LOAD_POLICY(APPLET(load_policy, BB_DIR_USR_SBIN, BB_SUID_DROP)) + IF_LOADFONT(APPLET(loadfont, BB_DIR_USR_SBIN, BB_SUID_DROP)) + IF_LOADKMAP(APPLET(loadkmap, BB_DIR_SBIN, BB_SUID_DROP)) ++IF_LOCK(APPLET(lock, BB_DIR_BIN, BB_SUID_DROP)) + IF_LOGGER(APPLET(logger, BB_DIR_USR_BIN, BB_SUID_DROP)) + /* Needs to be run by root or be suid root - needs to change uid and gid: */ + IF_LOGIN(APPLET(login, BB_DIR_BIN, BB_SUID_REQUIRE)) +--- a/miscutils/Config.src ++++ b/miscutils/Config.src +@@ -419,6 +419,11 @@ config FEATURE_HDPARM_HDIO_GETSET_DMA + help Enables the 'hdparm -d' option to get/set using_dma flag. - This is dangerous stuff, so you should probably say N. +config LOCK + bool "lock" -+ default y + help + Small utility for using locks in scripts + config MAKEDEVS bool "makedevs" - default n ---- a/miscutils/Kbuild -+++ b/miscutils/Kbuild -@@ -20,6 +20,7 @@ + default y +--- a/miscutils/Kbuild.src ++++ b/miscutils/Kbuild.src +@@ -29,6 +29,7 @@ lib-$(CONFIG_INOTIFYD) += inotifyd.o lib-$(CONFIG_FEATURE_LAST_SMALL)+= last.o lib-$(CONFIG_FEATURE_LAST_FANCY)+= last_fancy.o lib-$(CONFIG_LESS) += less.o @@ -47,7 +34,7 @@ lib-$(CONFIG_MICROCOM) += microcom.o --- /dev/null +++ b/miscutils/lock.c -@@ -0,0 +1,132 @@ +@@ -0,0 +1,135 @@ +/* + * Copyright (C) 2006 Felix Fietkau + * @@ -62,6 +49,9 @@ +#include +#include "busybox.h" + ++//usage:#define lock_trivial_usage NOUSAGE_STR ++//usage:#define lock_full_usage "" ++ +static int unlock = 0; +static int shared = 0; +static int waitonly = 0;