chiark / gitweb /
no newline in log messages
authorKay Sievers <kay.sievers@vrfy.org>
Sat, 23 Jun 2007 14:21:47 +0000 (16:21 +0200)
committerKay Sievers <kay.sievers@vrfy.org>
Sat, 23 Jun 2007 14:21:47 +0000 (16:21 +0200)
etc/udev/suse/64-device-mapper.rules
udev_selinux.c
udev_utils_file.c
udevd.c
udevinfo.c
udevstart.c
udevtest.c
udevtrigger.c

index f1d6c40..e8af567 100644 (file)
@@ -11,11 +11,10 @@ ENV{DM_UUID}=="?*", SYMLINK+="disk/by-id/dm-uuid-$env{DM_UUID}"
 
 ENV{DM_STATE}=="SUSPENDED", GOTO="device_mapper_end"
 ENV{DM_TARGET_TYPES}=="|*error*", GOTO="device_mapper_end"
-IMPORT{program}="vol_id --export $tempnode"
 
+IMPORT{program}="vol_id --export $tempnode"
 OPTIONS="link_priority=-100"
 ENV{DM_TARGET_TYPES}=="*snapshot-origin*", OPTIONS="link_priority=-90"
-
 ENV{ID_FS_USAGE}=="filesystem|other|crypto", ENV{ID_FS_UUID_ENC}=="?*", SYMLINK+="disk/by-uuid/$env{ID_FS_UUID_ENC}"
 ENV{ID_FS_USAGE}=="filesystem|other", ENV{ID_FS_LABEL_ENC}=="?*", SYMLINK+="disk/by-label/$env{ID_FS_LABEL_ENC}"
 
index 77c0e7d..1ad6e8a 100644 (file)
@@ -75,7 +75,7 @@ static char *get_media(const char *devname, int mode)
        }
 
        media = strdup(mediabuf);
-       info("selinux_get_media(%s)='%s'\n", devname, media);
+       info("selinux_get_media(%s)='%s'", devname, media);
 
 close_out:
        fclose(fp);
@@ -100,7 +100,7 @@ void selinux_setfilecon(const char *file, const char *devname, unsigned int mode
 
                if (ret < 0)
                        if (matchpathcon(file, mode, &scontext) < 0) {
-                               err("matchpathcon(%s) failed\n", file);
+                               err("matchpathcon(%s) failed", file);
                                return;
                        } 
 
@@ -128,7 +128,7 @@ void selinux_setfscreatecon(const char *file, const char *devname, unsigned int
 
                if (ret < 0)
                        if (matchpathcon(file, mode, &scontext) < 0) {
-                               err("matchpathcon(%s) failed\n", file);
+                               err("matchpathcon(%s) failed", file);
                                return;
                        }
 
@@ -155,10 +155,10 @@ void selinux_init(void)
         */
        if (is_selinux_running()) {
                if (!udev_root[0])
-                       err("selinux_init: udev_root not set\n");
+                       err("selinux_init: udev_root not set");
                matchpathcon_init_prefix(NULL, udev_root);
                if (getfscreatecon(&prev_scontext) < 0) {
-                       err("getfscreatecon failed\n");
+                       err("getfscreatecon failed");
                        prev_scontext = NULL;
                }
        }
index ba70b6b..44c3686 100644 (file)
@@ -45,14 +45,14 @@ int create_path(const char *path)
                pos--;
        pos[0] = '\0';
 
-       dbg("stat '%s'\n", p);
+       dbg("stat '%s'", p);
        if (stat(p, &stats) == 0 && (stats.st_mode & S_IFMT) == S_IFDIR)
                return 0;
 
        if (create_path (p) != 0)
                return -1;
 
-       dbg("mkdir '%s'\n", p);
+       dbg("mkdir '%s'", p);
        if (mkdir(p, 0755) == 0)
                return 0;
        if (errno == EEXIST)
diff --git a/udevd.c b/udevd.c
index 05df871..23df535 100644 (file)
--- a/udevd.c
+++ b/udevd.c
@@ -957,7 +957,6 @@ int main(int argc, char *argv[], char *envp[])
        selinux_init();
        dbg("version %s", UDEV_VERSION);
 
-       /* parse commandline options */
        while (1) {
                option = getopt_long(argc, argv, "dtvhV", options, NULL);
                if (option == -1)
index 82057de..d0b1c44 100644 (file)
@@ -265,7 +265,6 @@ int main(int argc, char *argv[], char *envp[])
                goto exit;
        }
 
-       /* get command line options */
        while (1) {
                option = getopt_long(argc, argv, "aen:p:q:rVh", options, NULL);
                if (option == -1)
@@ -279,7 +278,7 @@ int main(int argc, char *argv[], char *envp[])
                                strlcpy(name, &optarg[strlen(udev_root)+1], sizeof(name));
                        else
                                strlcpy(name, optarg, sizeof(name));
-                       dbg("name: %s\n", name);
+                       dbg("name: %s", name);
                        break;
                case 'p':
                        /* remove /sys if given */
@@ -287,10 +286,9 @@ int main(int argc, char *argv[], char *envp[])
                                strlcpy(path, &optarg[strlen(sysfs_path)], sizeof(path));
                        else
                                strlcpy(path, optarg, sizeof(path));
-                       dbg("path: %s\n", path);
+                       dbg("path: %s", path);
                        break;
                case 'q':
-                       dbg("udev query: %s\n", optarg);
                        action = ACTION_QUERY;
                        if (strcmp(optarg, "name") == 0) {
                                query = QUERY_NAME;
index a381c41..6af5860 100644 (file)
@@ -68,7 +68,7 @@ static int device_list_insert(const char *path, struct list_head *device_list)
        struct device *new_device;
        const char *devpath = &path[strlen(sysfs_path)];
 
-       dbg("insert: '%s'\n", devpath);
+       dbg("insert: '%s'", devpath);
 
        list_for_each_entry(loop_device, device_list, node) {
                if (strcmp(loop_device->path, devpath) > 0) {
index 292a949..418d43d 100644 (file)
@@ -44,8 +44,7 @@ void log_message (int priority, const char *format, ...)
        va_start(args, format);
        vprintf(format, args);
        va_end(args);
-       if (format[strlen(format)-1] != '\n')
-               printf("\n");
+       printf("\n");
 }
 #endif
 
index 7577c5f..3b5be20 100644 (file)
@@ -118,12 +118,12 @@ static void trigger_uevent(const char *devpath)
 
        fd = open(filename, O_WRONLY);
        if (fd < 0) {
-               dbg("error on opening %s: %s\n", filename, strerror(errno));
+               dbg("error on opening %s: %s", filename, strerror(errno));
                return;
        }
 
        if (write(fd, "add", 3) < 0)
-               info("error on triggering %s: %s\n", filename, strerror(errno));
+               info("error on triggering %s: %s", filename, strerror(errno));
 
        close(fd);
 }