commit-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[hurd] 03/07: procfs: define macros for the default argument values


From: Samuel Thibault
Subject: [hurd] 03/07: procfs: define macros for the default argument values
Date: Mon, 16 Sep 2013 07:41:32 +0000

This is an automated email from the git hooks/post-receive script.

sthibault pushed a commit to branch procfs-jkoenig
in repository hurd.

commit 2f13ab11aa71a2b8fb6e045a9ff81b7b2252cbe0
Author: Justus Winter <address@hidden>
Date:   Fri Jun 28 18:37:44 2013 +0200

    procfs: define macros for the default argument values
    
    Define a macro for the default value of each command line
    parameter. This allows one to generate a minimal response to
    fsys_get_options requests.
    
    * procfs/main.c: New macro definitions for default values.
---
 main.c |   17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)

diff --git a/main.c b/main.c
index b678a71..fc4c5e5 100644
--- a/main.c
+++ b/main.c
@@ -37,6 +37,13 @@ pid_t opt_fake_self;
 pid_t opt_kernel_pid;
 uid_t opt_anon_owner;
 
+/* Default values */
+#define OPT_CLK_TCK    sysconf(_SC_CLK_TCK)
+#define OPT_STAT_MODE  0400
+#define OPT_FAKE_SELF  -1
+#define OPT_KERNEL_PID 2
+#define OPT_ANON_OWNER 0
+
 #define NODEV_KEY  -1 /* <= 0, so no short option. */
 #define NOEXEC_KEY -2 /* Likewise. */
 #define NOSUID_KEY -3 /* Likewise. */
@@ -236,11 +243,11 @@ int main (int argc, char **argv)
   mach_port_t bootstrap;
   error_t err;
 
-  opt_clk_tck = sysconf(_SC_CLK_TCK);
-  opt_stat_mode = 0400;
-  opt_fake_self = -1;
-  opt_kernel_pid = 2;
-  opt_anon_owner = 0;
+  opt_clk_tck = OPT_CLK_TCK;
+  opt_stat_mode = OPT_STAT_MODE;
+  opt_fake_self = OPT_FAKE_SELF;
+  opt_kernel_pid = OPT_KERNEL_PID;
+  opt_anon_owner = OPT_ANON_OWNER;
   err = argp_parse (&argp, argc, argv, 0, 0, 0);
   if (err)
     error (1, err, "Could not parse command line");

-- 
Alioth's /usr/local/bin/git-commit-notice on 
/srv/git.debian.org/git/pkg-hurd/hurd.git



reply via email to

[Prev in Thread] Current Thread [Next in Thread]