]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
rfkill: make command to build in util-linux project
authorSami Kerola <kerolasa@iki.fi>
Sat, 24 Jun 2017 19:19:26 +0000 (20:19 +0100)
committerSami Kerola <kerolasa@iki.fi>
Wed, 30 Aug 2017 19:32:48 +0000 (20:32 +0100)
After this commit the command merely builds, but does not confirm style used
in util-linux project.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
.gitignore
configure.ac
sys-utils/Makemodule.am
sys-utils/rfkill.c

index 7a6c4afc27ab213f35d797eacd9165d2b6a6a5fa..c638bdf99f015d299d7da584c4a98c3e3b3b287e 100644 (file)
@@ -140,6 +140,7 @@ ylwrap
 /renice
 /resizepart
 /rev
+/rfkill
 /rtcwake
 /runuser
 /sample-*
index 1dccb420c5fad3e5771c68b8815c5968471a915d..ac4871a8a912ac1c95509dc64c60fd953097270f 100644 (file)
@@ -1617,6 +1617,9 @@ AM_CONDITIONAL([BUILD_LSNS], [test "x$build_lsns" = xyes])
 UL_BUILD_INIT([renice], [yes])
 AM_CONDITIONAL([BUILD_RENICE], [test "x$build_renice" = xyes])
 
+UL_BUILD_INIT([rfkill], [yes])
+AM_CONDITIONAL([BUILD_RFKILL], [test "x$build_rfkill" = xyes])
+
 UL_BUILD_INIT([setsid], [yes])
 AM_CONDITIONAL([BUILD_SETSID], [test "x$build_setsid" = xyes])
 
index 66b540874a00d9c4bcfe3d0178fd9245681ba316..2148fd91e9d9eea28e81e58ea0cec0cd31c95bd7 100644 (file)
@@ -59,6 +59,12 @@ dist_man_MANS += sys-utils/renice.1
 renice_SOURCES = sys-utils/renice.c
 endif
 
+if BUILD_RFKILL
+usrbin_exec_PROGRAMS += rfkill
+dist_man_MANS += sys-utils/rfkill.8
+rfkill_SOURCES = sys-utils/rfkill.c
+endif
+
 if BUILD_SETSID
 usrbin_exec_PROGRAMS += setsid
 dist_man_MANS += sys-utils/setsid.1
index 60f8cdc2738121db9374e997e2ab763baefa7c76..ad2af36eaa5bbf81e09641c9d7007e8a11d76765 100644 (file)
 #include <sys/poll.h>
 #include <sys/time.h>
 
-#include "rfkill.h"
-#include "core.h"
+#include <linux/rfkill.h>
+
+#include "c.h"
+#include "closestream.h"
+#include "nls.h"
 
 static void rfkill_event(void)
 {
@@ -313,7 +316,7 @@ static void usage(void)
 
        fprintf(stderr, "Usage:\t%s [options] command\n", argv0);
        fprintf(stderr, "Options:\n");
-       fprintf(stderr, "\t--version\tshow version (%s)\n", rfkill_version);
+       fprintf(stderr, "\t--version\tshow version (%s)\n", PACKAGE_VERSION);
        fprintf(stderr, "Commands:\n");
        fprintf(stderr, "\thelp\n");
        fprintf(stderr, "\tevent\n");
@@ -329,7 +332,7 @@ static void usage(void)
 
 static void version(void)
 {
-       printf("rfkill %s\n", rfkill_version);
+       printf("rfkill %s\n", PACKAGE_VERSION);
 }
 
 int main(int argc, char **argv)