[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 095/104] virtiofsd: convert more fprintf and perror to use fuse l
From: |
Dr. David Alan Gilbert (git) |
Subject: |
[PATCH 095/104] virtiofsd: convert more fprintf and perror to use fuse log infra |
Date: |
Thu, 12 Dec 2019 16:38:55 +0000 |
From: Eryu Guan <address@hidden>
Signed-off-by: Eryu Guan <address@hidden>
---
tools/virtiofsd/fuse_signals.c | 6 +++++-
tools/virtiofsd/helper.c | 9 ++++++---
2 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/tools/virtiofsd/fuse_signals.c b/tools/virtiofsd/fuse_signals.c
index 10a6f88088..edabf24e0d 100644
--- a/tools/virtiofsd/fuse_signals.c
+++ b/tools/virtiofsd/fuse_signals.c
@@ -11,6 +11,7 @@
#include "fuse_i.h"
#include "fuse_lowlevel.h"
+#include <errno.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
@@ -46,12 +47,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) {
+ fuse_log(FUSE_LOG_ERR, "fuse: cannot set signal handler: %s\n",
+ strerror(errno));
perror("fuse: cannot set signal handler");
return -1;
}
diff --git a/tools/virtiofsd/helper.c b/tools/virtiofsd/helper.c
index 7b28507a38..bcb8c05063 100644
--- a/tools/virtiofsd/helper.c
+++ b/tools/virtiofsd/helper.c
@@ -200,7 +200,8 @@ int fuse_daemonize(int foreground)
char completed;
if (pipe(waiter)) {
- perror("fuse_daemonize: pipe");
+ fuse_log(FUSE_LOG_ERR, "fuse_daemonize: pipe: %s\n",
+ strerror(errno));
return -1;
}
@@ -210,7 +211,8 @@ int fuse_daemonize(int foreground)
*/
switch (fork()) {
case -1:
- perror("fuse_daemonize: fork");
+ fuse_log(FUSE_LOG_ERR, "fuse_daemonize: fork: %s\n",
+ strerror(errno));
return -1;
case 0:
break;
@@ -220,7 +222,8 @@ int fuse_daemonize(int foreground)
}
if (setsid() == -1) {
- perror("fuse_daemonize: setsid");
+ fuse_log(FUSE_LOG_ERR, "fuse_daemonize: setsid: %s\n",
+ strerror(errno));
return -1;
}
--
2.23.0
- [PATCH 085/104] virtiofsd: Support remote posix locks, (continued)
- [PATCH 085/104] virtiofsd: Support remote posix locks, Dr. David Alan Gilbert (git), 2019/12/12
- [PATCH 087/104] virtiofsd: prevent fv_queue_thread() vs virtio_loop() races, Dr. David Alan Gilbert (git), 2019/12/12
- [PATCH 089/104] virtiofsd: prevent races with lo_dirp_put(), Dr. David Alan Gilbert (git), 2019/12/12
- [PATCH 088/104] virtiofsd: make lo_release() atomic, Dr. David Alan Gilbert (git), 2019/12/12
- [PATCH 091/104] libvhost-user: Fix some memtable remap cases, Dr. David Alan Gilbert (git), 2019/12/12
- [PATCH 090/104] virtiofsd: rename inode->refcount to inode->nlookup, Dr. David Alan Gilbert (git), 2019/12/12
- [PATCH 092/104] virtiofsd: add man page, Dr. David Alan Gilbert (git), 2019/12/12
- [PATCH 094/104] virtiofsd: do not always set FUSE_FLOCK_LOCKS, Dr. David Alan Gilbert (git), 2019/12/12
- [PATCH 095/104] virtiofsd: convert more fprintf and perror to use fuse log infra,
Dr. David Alan Gilbert (git) <=
- [PATCH 093/104] virtiofsd: introduce inode refcount to prevent use-after-free, Dr. David Alan Gilbert (git), 2019/12/12
- [PATCH 096/104] virtiofsd: Reset O_DIRECT flag during file open, Dr. David Alan Gilbert (git), 2019/12/12
- [PATCH 097/104] virtiofsd: Fix data corruption with O_APPEND wirte in writeback mode, Dr. David Alan Gilbert (git), 2019/12/12
- [PATCH 098/104] virtiofsd: add definition of fuse_buf_writev(), Dr. David Alan Gilbert (git), 2019/12/12
- [PATCH 099/104] virtiofsd: use fuse_buf_writev to replace fuse_buf_write for better performance, Dr. David Alan Gilbert (git), 2019/12/12
- [PATCH 102/104] virtiofsd: fix lo_destroy() resource leaks, Dr. David Alan Gilbert (git), 2019/12/12
- [PATCH 103/104] virtiofsd: add --thread-pool-size=NUM option, Dr. David Alan Gilbert (git), 2019/12/12
- [PATCH 101/104] virtiofsd: prevent FUSE_INIT/FUSE_DESTROY races, Dr. David Alan Gilbert (git), 2019/12/12
- [PATCH 100/104] virtiofsd: process requests in a thread pool, Dr. David Alan Gilbert (git), 2019/12/12
- [PATCH 104/104] virtiofsd: Convert lo_destroy to take the lo->mutex lock itself, Dr. David Alan Gilbert (git), 2019/12/12