chiark / gitweb /
fix the new warnings I asked for
authorKay Sievers <kay@pim.off.vrfy.org>
Thu, 27 Oct 2005 18:32:07 +0000 (20:32 +0200)
committerKay Sievers <kay@pim.off.vrfy.org>
Thu, 27 Oct 2005 18:32:07 +0000 (20:32 +0200)
Signed-off-by: Kay Sievers <kay.sievers@suse.de>
test/simple-build-check.sh
udev_rules_parse.c
udevcontrol.c
udevd.c
udeveventrecorder.c
udevinitsend.c
udevmonitor.c

index 6572a39..daf0b75 100755 (executable)
@@ -17,12 +17,12 @@ echo KERNEL_DIR: "$KERNEL_DIR"
 
 # with debug
 make clean EXTRAS="$EXTRAS" >/dev/null
-make all -j4 $MAKEOPTS DEBUG=true EXTRAS="$EXTRAS"  || exit
+make all -j4 $MAKEOPTS DEBUG=true EXTRAS="$EXTRAS" || exit
 echo -e "\n\n"
 
 # without any logging
 make clean EXTRAS="$EXTRAS" >/dev/null
-make all $MAKEOPTS USE_LOG=false EXTRAS="$EXTRAS"  || exit
+make all $MAKEOPTS USE_LOG=false EXTRAS="$EXTRAS" || exit
 echo -e "\n\n"
 
 # klibc and debug
index c14164f..7d1853a 100644 (file)
@@ -437,7 +437,7 @@ static int add_to_rules(struct udev_rules *rules, char *line)
                                        char owner[32];
                                        uid_t uid = lookup_user(value);
                                        dbg("replacing username='%s' by id=%i", value, uid);
-                                       sprintf(owner, "%li", uid);
+                                       sprintf(owner, "%u", (unsigned int) uid);
                                        add_rule_key(rule, &rule->owner, operation, owner);
                                        continue;
                                }
@@ -456,7 +456,7 @@ static int add_to_rules(struct udev_rules *rules, char *line)
                                        char group[32];
                                        gid_t gid = lookup_group(value);
                                        dbg("replacing groupname='%s' by id=%i", value, gid);
-                                       sprintf(group, "%li", gid);
+                                       sprintf(group, "%u", (unsigned int) gid);
                                        add_rule_key(rule, &rule->group, operation, group);
                                        continue;
                                }
index f16f6a1..6651e97 100644 (file)
 
 /* global variables */
 static int sock = -1;
-static int log = 0;
+static int udev_log = 0;
 
 #ifdef USE_LOG
 void log_message (int priority, const char *format, ...)
 {
        va_list args;
 
-       if (priority > log)
+       if (priority > udev_log)
                return;
 
        va_start(args, format);
@@ -69,7 +69,7 @@ int main(int argc, char *argv[], char *envp[])
 
        env = getenv("UDEV_LOG");
        if (env)
-               log = log_priority(env);
+               udev_log = log_priority(env);
 
        logging_init("udevcontrol");
        dbg("version %s", UDEV_VERSION);
diff --git a/udevd.c b/udevd.c
index a926715..bd1324e 100644 (file)
--- a/udevd.c
+++ b/udevd.c
@@ -67,7 +67,7 @@ static int event_timeout;
 static int max_childs;
 static int max_childs_running;
 static unsigned long long expected_seqnum;
-static char log[32];
+static char udev_log[32];
 
 static LIST_HEAD(msg_list);
 static LIST_HEAD(exec_list);
@@ -559,8 +559,8 @@ static struct uevent_msg *get_udevd_msg(void)
                intval = (int *) usend_msg.envbuf;
                info("udevd message (SET_LOG_PRIORITY) received, udev_log_priority=%i", *intval);
                udev_log_priority = *intval;
-               sprintf(log, "UDEV_LOG=%i", udev_log_priority);
-               putenv(log);
+               sprintf(udev_log, "UDEV_LOG=%i", udev_log_priority);
+               putenv(udev_log);
                break;
        case UDEVD_SET_MAX_CHILDS:
                intval = (int *) usend_msg.envbuf;
@@ -912,8 +912,8 @@ int main(int argc, char *argv[], char *envp[])
        info("initialize max_childs_running to %u", max_childs_running);
 
        /* export log_priority , as called programs may want to follow that setting */
-       sprintf(log, "UDEV_LOG=%i", udev_log_priority);
-       putenv(log);
+       sprintf(udev_log, "UDEV_LOG=%i", udev_log_priority);
+       putenv(udev_log);
 
        while (!udev_exit) {
                struct uevent_msg *msg;
index 9a3c3e1..8ac344a 100644 (file)
 #define BUFSIZE 12345
 #define FNSIZE  123
 
-static int log = 0;
+static int udev_log = 0;
 
 #ifdef USE_LOG
 void log_message (int priority, const char *format, ...)
 {
        va_list args;
 
-       if (priority > log)
+       if (priority > udev_log)
                return;
 
        va_start(args, format);
@@ -67,7 +67,7 @@ int main(int argc, char **argv, char **envp)
 
        env = getenv("UDEV_LOG");
        if (env)
-               log = log_priority(env);
+               udev_log = log_priority(env);
 
        logging_init("udeveventrecorder");
        dbg("version %s", UDEV_VERSION);
index ea05734..4f50da8 100644 (file)
 #include "udev_utils.h"
 #include "logging.h"
 
-static int log = 0;
+static int udev_log = 0;
 
 #ifdef USE_LOG
 void log_message (int priority, const char *format, ...)
 {
        va_list args;
 
-       if (priority > log)
+       if (priority > udev_log)
                return;
 
        va_start(args, format);
@@ -174,7 +174,7 @@ int main(int argc, char *argv[], char *envp[])
 
        env = getenv("UDEV_LOG");
        if (env)
-               log = log_priority(env);
+               udev_log = log_priority(env);
 
        logging_init("udevinitsend");
        dbg("version %s", UDEV_VERSION);
index 33dff2a..382cbb1 100644 (file)
@@ -181,7 +181,7 @@ int main(int argc, char *argv[])
                                fprintf(stderr, "error receiving uevent message\n");
                                continue;
                        }
-                       printf("UEVENT[%i] %s\n", time(NULL), buf);
+                       printf("UEVENT[%llu] %s\n", (unsigned long long) time(NULL), buf);
                }
 
                if ((udev_monitor_sock > 0) && FD_ISSET(udev_monitor_sock, &readfds)) {
@@ -190,7 +190,7 @@ int main(int argc, char *argv[])
                                fprintf(stderr, "error receiving udev message\n");
                                continue;
                        }
-                       printf("UDEV  [%i] %s\n", time(NULL), buf);
+                       printf("UDEV  [%llu] %s\n", (unsigned long long) time(NULL), buf);
                }
 
                if (buflen == 0)