mirror of
https://github.com/clearlinux/systemd-stable.git
synced 2026-10-17 05:40:54 +00:00
udev: don't close std{in,out,err}
Rather than printing debug output to stderr and redirecting this to /dev/null when not wanted, use the correct log_*() function in the first place.
This commit is contained in:
@@ -1221,18 +1221,6 @@ int main(int argc, char *argv[]) {
|
|||||||
|
|
||||||
log_info("starting version " VERSION "\n");
|
log_info("starting version " VERSION "\n");
|
||||||
|
|
||||||
if (!arg_debug) {
|
|
||||||
int fd;
|
|
||||||
|
|
||||||
fd = open("/dev/null", O_RDWR);
|
|
||||||
if (fd >= 0) {
|
|
||||||
dup2(fd, STDIN_FILENO);
|
|
||||||
dup2(fd, STDOUT_FILENO);
|
|
||||||
dup2(fd, STDERR_FILENO);
|
|
||||||
close(fd);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fd_inotify = udev_watch_init(udev);
|
fd_inotify = udev_watch_init(udev);
|
||||||
if (fd_inotify < 0) {
|
if (fd_inotify < 0) {
|
||||||
log_error("error initializing inotify");
|
log_error("error initializing inotify");
|
||||||
|
|||||||
Reference in New Issue
Block a user