summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarco d'Itri <md@Linux.IT>2005-11-07 18:52:03 +0100
committerKay Sievers <kay.sievers@suse.de>2005-11-07 18:52:03 +0100
commitdf4e89bfa61b6aaea41619842aa9032dd1af072e (patch)
tree73350d1017e1c531d6b19c60838d9d8082d3c282
parentff3e4bed21aaff673284f2e024da26c1e39cfda6 (diff)
move some logging from dbg() to info()
-rw-r--r--udev_add.c12
-rw-r--r--udev_db.c2
-rw-r--r--udev_libc_wrapper.c6
-rw-r--r--udev_remove.c2
-rw-r--r--udev_rules_parse.c2
-rw-r--r--udev_selinux.c12
-rw-r--r--udev_utils.c2
-rw-r--r--udev_utils_file.c6
-rw-r--r--udevd.c6
9 files changed, 25 insertions, 25 deletions
diff --git a/udev_add.c b/udev_add.c
index a811b5a17c..f4ad55a893 100644
--- a/udev_add.c
+++ b/udev_add.c
@@ -73,7 +73,7 @@ int udev_make_node(struct udevice *udev, const char *file, dev_t devt, mode_t mo
}
if (unlink(file) != 0)
- dbg("unlink(%s) failed: %s", file, strerror(errno));
+ err("unlink(%s) failed: %s", file, strerror(errno));
else
dbg("already present file '%s' unlinked", file);
@@ -90,14 +90,14 @@ create:
perms:
dbg("chmod(%s, %#o)", file, mode);
if (chmod(file, mode) != 0) {
- dbg("chmod(%s, %#o) failed: %s", file, mode, strerror(errno));
+ err("chmod(%s, %#o) failed: %s", file, mode, strerror(errno));
goto exit;
}
if (uid != 0 || gid != 0) {
dbg("chown(%s, %u, %u)", file, uid, gid);
if (chown(file, uid, gid) != 0) {
- dbg("chown(%s, %u, %u) failed: %s",
+ err("chown(%s, %u, %u) failed: %s",
file, uid, gid, strerror(errno));
goto exit;
}
@@ -222,7 +222,7 @@ static int create_node(struct udevice *udev, struct sysfs_class_device *class_de
retval = symlink(linktarget, filename);
selinux_resetfscreatecon();
if (retval != 0)
- dbg("symlink(%s, %s) failed: %s",
+ err("symlink(%s, %s) failed: %s",
linktarget, filename, strerror(errno));
}
}
@@ -244,7 +244,7 @@ static int rename_net_if(struct udevice *udev)
sk = socket(PF_INET, SOCK_DGRAM, 0);
if (sk < 0) {
- dbg("error opening socket: %s", strerror(errno));
+ err("error opening socket: %s", strerror(errno));
return -1;
}
@@ -254,7 +254,7 @@ static int rename_net_if(struct udevice *udev)
retval = ioctl(sk, SIOCSIFNAME, &ifr);
if (retval != 0)
- dbg("error changing net interface name: %s", strerror(errno));
+ err("error changing net interface name: %s", strerror(errno));
close(sk);
return retval;
diff --git a/udev_db.c b/udev_db.c
index f00308bd2f..5caf3fda80 100644
--- a/udev_db.c
+++ b/udev_db.c
@@ -129,7 +129,7 @@ int udev_db_get_device(struct udevice *udev, const char *devpath)
devpath_to_db_path(devpath, filename, sizeof(filename));
if (file_map(filename, &buf, &bufsize) != 0) {
- dbg("no db file to read %s: %s", filename, strerror(errno));
+ info("no db file to read %s: %s", filename, strerror(errno));
return -1;
}
diff --git a/udev_libc_wrapper.c b/udev_libc_wrapper.c
index a7a8c5342d..fe38993cd7 100644
--- a/udev_libc_wrapper.c
+++ b/udev_libc_wrapper.c
@@ -102,7 +102,7 @@ uid_t lookup_user(const char *user)
pw = getpwnam(user);
if (pw == NULL)
- dbg("specified user unknown '%s'", user);
+ info("specified user unknown '%s'", user);
else
uid = pw->pw_uid;
@@ -116,7 +116,7 @@ gid_t lookup_group(const char *group)
gr = getgrnam(group);
if (gr == NULL)
- dbg("specified group unknown '%s'", group);
+ info("specified group unknown '%s'", group);
else
gid = gr->gr_gid;
@@ -144,7 +144,7 @@ static unsigned long get_id_by_name(const char *uname, const char *dbfile)
char *tail;
if (file_map(dbfile, &buf, &bufsize) != 0) {
- dbg("can't open '%s' as db file: %s", dbfile, strerror(errno));
+ err("can't open '%s' as db file: %s", dbfile, strerror(errno));
return 0;
}
dbg("search '%s' in '%s'", uname, dbfile);
diff --git a/udev_remove.c b/udev_remove.c
index 621fcc1960..cb5523af92 100644
--- a/udev_remove.c
+++ b/udev_remove.c
@@ -56,7 +56,7 @@ static int delete_path(const char *path)
if (retval) {
if (errno == ENOTEMPTY)
return 0;
- dbg("rmdir(%s) failed: %s", path, strerror(errno));
+ err("rmdir(%s) failed: %s", path, strerror(errno));
break;
}
dbg("removed '%s'", path);
diff --git a/udev_rules_parse.c b/udev_rules_parse.c
index b664b983fb..7fa21afa8c 100644
--- a/udev_rules_parse.c
+++ b/udev_rules_parse.c
@@ -617,7 +617,7 @@ int udev_rules_init(struct udev_rules *rules, int resolve_names)
else
dbg("empty rules file '%s'", name_loop->name);
} else
- dbg("could not read '%s'", name_loop->name);
+ err("could not read '%s': %s", name_loop->name, strerror(errno));
list_del(&name_loop->node);
free(name_loop);
}
diff --git a/udev_selinux.c b/udev_selinux.c
index 719ff6403e..6ec359edd4 100644
--- a/udev_selinux.c
+++ b/udev_selinux.c
@@ -100,12 +100,12 @@ void selinux_setfilecon(const char *file, const char *devname, unsigned int mode
if (ret < 0)
if (matchpathcon(file, mode, &scontext) < 0) {
- dbg("matchpathcon(%s) failed\n", file);
+ err("matchpathcon(%s) failed\n", file);
return;
}
if (setfilecon(file, scontext) < 0)
- dbg("setfilecon %s failed: %s", file, strerror(errno));
+ err("setfilecon %s failed: %s", file, strerror(errno));
freecon(scontext);
}
@@ -126,12 +126,12 @@ void selinux_setfscreatecon(const char *file, const char *devname, unsigned int
if (ret < 0)
if (matchpathcon(file, mode, &scontext) < 0) {
- dbg("matchpathcon(%s) failed\n", file);
+ err("matchpathcon(%s) failed\n", file);
return;
}
if (setfscreatecon(scontext) < 0)
- dbg("setfscreatecon %s failed: %s", file, strerror(errno));
+ err("setfscreatecon %s failed: %s", file, strerror(errno));
freecon(scontext);
}
@@ -141,7 +141,7 @@ void selinux_resetfscreatecon(void)
{
if (is_selinux_running()) {
if (setfscreatecon(prev_scontext) < 0)
- dbg("setfscreatecon failed: %s", strerror(errno));
+ err("setfscreatecon failed: %s", strerror(errno));
}
}
@@ -153,7 +153,7 @@ void selinux_init(void)
*/
if (is_selinux_running()) {
if (getfscreatecon(&prev_scontext) < 0) {
- dbg("getfscreatecon failed\n");
+ err("getfscreatecon failed\n");
prev_scontext = NULL;
}
}
diff --git a/udev_utils.c b/udev_utils.c
index 04258a39c2..581ba9e80a 100644
--- a/udev_utils.c
+++ b/udev_utils.c
@@ -139,7 +139,7 @@ int add_matching_files(struct list_head *name_list, const char *dirname, const c
dbg("open directory '%s'", dirname);
dir = opendir(dirname);
if (dir == NULL) {
- dbg("unable to open '%s': %s", dirname, strerror(errno));
+ err("unable to open '%s': %s", dirname, strerror(errno));
return -1;
}
diff --git a/udev_utils_file.c b/udev_utils_file.c
index 23f61196b7..a3dab58b36 100644
--- a/udev_utils_file.c
+++ b/udev_utils_file.c
@@ -72,18 +72,18 @@ int unlink_secure(const char *filename)
retval = chown(filename, 0, 0);
if (retval)
- dbg("chown(%s, 0, 0) failed: %s", filename, strerror(errno));
+ err("chown(%s, 0, 0) failed: %s", filename, strerror(errno));
retval = chmod(filename, 0000);
if (retval)
- dbg("chmod(%s, 0000) failed: %s", filename, strerror(errno));
+ err("chmod(%s, 0000) failed: %s", filename, strerror(errno));
retval = unlink(filename);
if (errno == ENOENT)
retval = 0;
if (retval)
- dbg("unlink(%s) failed: %s", filename, strerror(errno));
+ err("unlink(%s) failed: %s", filename, strerror(errno));
return retval;
}
diff --git a/udevd.c b/udevd.c
index 86905923be..333ad4143a 100644
--- a/udevd.c
+++ b/udevd.c
@@ -743,10 +743,10 @@ int main(int argc, char *argv[], char *envp[])
/* init sockets to receive events */
if (init_udevd_socket() < 0) {
if (errno == EADDRINUSE) {
- dbg("another udevd running, exit");
+ err("another udevd running, exit");
rc = 1;
} else {
- dbg("error initializing udevd socket: %s", strerror(errno));
+ err("error initializing udevd socket: %s", strerror(errno));
rc = 2;
}
goto exit;
@@ -872,7 +872,7 @@ int main(int argc, char *argv[], char *envp[])
fdcount = select(maxfd+1, &readfds, NULL, NULL, NULL);
if (fdcount < 0) {
if (errno != EINTR)
- dbg("error in select: %s", strerror(errno));
+ err("error in select: %s", strerror(errno));
continue;
}