1
0
mirror of https://github.com/systemd/systemd.git synced 2024-10-28 03:25:31 +03:00

no newline in log messages

This commit is contained in:
Kay Sievers 2007-06-23 16:21:47 +02:00
parent 3df3c93e25
commit 92b229c727
8 changed files with 14 additions and 19 deletions

View 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}"

View 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;
}
}

View 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)

View File

@ -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)

View 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;

View 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) {

View 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

View 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);
}