chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
update TODO
[elogind.git]
/
src
/
udev
/
ata_id
/
ata_id.c
diff --git
a/src/udev/ata_id/ata_id.c
b/src/udev/ata_id/ata_id.c
index 28e9acb296bf2b628d759a0a5835f9e9d7ebb611..89628c929d38be75fcef356918ea4fdb11f88a42 100644
(file)
--- a/
src/udev/ata_id/ata_id.c
+++ b/
src/udev/ata_id/ata_id.c
@@
-405,14
+405,6
@@
out:
return ret;
}
return ret;
}
-_printf_(6,0)
-static void log_fn(struct udev *udev, int priority,
- const char *file, int line, const char *fn,
- const char *format, va_list args)
-{
- vsyslog(priority, format, args);
-}
-
int main(int argc, char *argv[])
{
struct udev *udev;
int main(int argc, char *argv[])
{
struct udev *udev;
@@
-435,13
+427,13
@@
int main(int argc, char *argv[])
{}
};
{}
};
+ log_parse_environment();
+ log_open();
+
udev = udev_new();
if (udev == NULL)
goto exit;
udev = udev_new();
if (udev == NULL)
goto exit;
- log_open();
- udev_set_log_fn(udev, log_fn);
-
while (1) {
int option;
while (1) {
int option;
@@
-463,14
+455,14
@@
int main(int argc, char *argv[])
node = argv[optind];
if (node == NULL) {
node = argv[optind];
if (node == NULL) {
- log_error("no node specified
\n
");
+ log_error("no node specified");
rc = 1;
goto exit;
}
rc = 1;
goto exit;
}
- fd = open(node, O_RDONLY|O_NONBLOCK);
+ fd = open(node, O_RDONLY|O_NONBLOCK
|O_CLOEXEC
);
if (fd < 0) {
if (fd < 0) {
- log_error("unable to open '%s'
\n
", node);
+ log_error("unable to open '%s'", node);
rc = 1;
goto exit;
}
rc = 1;
goto exit;
}
@@
-502,7
+494,7
@@
int main(int argc, char *argv[])
} else {
/* If this fails, then try HDIO_GET_IDENTITY */
if (ioctl(fd, HDIO_GET_IDENTITY, &id) != 0) {
} else {
/* If this fails, then try HDIO_GET_IDENTITY */
if (ioctl(fd, HDIO_GET_IDENTITY, &id) != 0) {
- log_debug
("HDIO_GET_IDENTITY failed for '%s': %m\n
", node);
+ log_debug
_errno(errno, "HDIO_GET_IDENTITY failed for '%s': %m
", node);
rc = 2;
goto close;
}
rc = 2;
goto close;
}