summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--helpers/mknod.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/helpers/mknod.c b/helpers/mknod.c
index 93ef974..7328d66 100644
--- a/helpers/mknod.c
+++ b/helpers/mknod.c
@@ -26,6 +26,8 @@
#include <string.h>
#include <sys/stat.h>
#include <unistd.h>
+#include "defs.h"
+#include "mode.h"
#ifdef ENABLE_NLS
#include <locale.h>
@@ -130,7 +132,16 @@ main(int argc, char *argv[])
#endif
switch(opt) {
case 'm':
- /* TODO: Parse mode. */
+ mode = umask(0);
+ umask(mode);
+ mode = 0666 ^ mode;
+ if (opkg_opk_helper_mode_parse(mode, optarg,
+ &mode) != OPKG_OPK_OK) {
+ fprintf(stderr, _("%s: Invalid mode "
+ "\"%s\"\n"),
+ program_name, optarg);
+ return EXIT_FAILURE;
+ }
break;
default:
fprintf(stderr, _("%s: Warning: Unknown option:"