diff options
author | Eryu Guan <eguan@linux.alibaba.com> | 2019-08-09 16:25:36 +0800 |
---|---|---|
committer | Dr. David Alan Gilbert <dgilbert@redhat.com> | 2020-01-23 16:41:37 +0000 |
commit | fc1aed0bf96259d0b46b1cfea7497b7762c4ee3d (patch) | |
tree | c33a8ff4a94ad38f7eafee85d7ee2abeef05fe5c /tools/virtiofsd/fuse_signals.c | |
parent | e468d4af5f5192ab33283464a9f6933044ce47f7 (diff) |
virtiofsd: convert more fprintf and perror to use fuse log infra
Signed-off-by: Eryu Guan <eguan@linux.alibaba.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Misono Tomohiro <misono.tomohiro@jp.fujitsu.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Diffstat (limited to 'tools/virtiofsd/fuse_signals.c')
-rw-r--r-- | tools/virtiofsd/fuse_signals.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/tools/virtiofsd/fuse_signals.c b/tools/virtiofsd/fuse_signals.c index dc7c8ac025..f18625b6e2 100644 --- a/tools/virtiofsd/fuse_signals.c +++ b/tools/virtiofsd/fuse_signals.c @@ -12,6 +12,7 @@ #include "fuse_i.h" #include "fuse_lowlevel.h" +#include <errno.h> #include <signal.h> #include <stdio.h> #include <stdlib.h> @@ -47,13 +48,15 @@ static int set_one_signal_handler(int sig, void (*handler)(int), int remove) sa.sa_flags = 0; if (sigaction(sig, NULL, &old_sa) == -1) { - perror("fuse: cannot get old signal handler"); + fuse_log(FUSE_LOG_ERR, "fuse: cannot get old signal handler: %s\n", + strerror(errno)); return -1; } if (old_sa.sa_handler == (remove ? handler : SIG_DFL) && sigaction(sig, &sa, NULL) == -1) { - perror("fuse: cannot set signal handler"); + fuse_log(FUSE_LOG_ERR, "fuse: cannot set signal handler: %s\n", + strerror(errno)); return -1; } return 0; |