Recent changes (master)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The following changes since commit df9e8b65a52fdab5a1ac48847c44d7201faa3cf1:

  Merge branch 'dfs_update_13_api' of https://github.com/johannlombardi/fio (2021-08-13 10:01:31 -0600)

are available in the Git repository at:

  git://git.kernel.dk/fio.git master

for you to fetch changes up to 864314464e2772a9885da34ea041f130073affe9:

  Merge branch 'patch-1' of https://github.com/antroseco/fio (2021-08-18 10:47:55 -0600)

----------------------------------------------------------------
Andreas Economides (1):
      server: reopen standard streams to /dev/null

Jens Axboe (1):
      Merge branch 'patch-1' of https://github.com/antroseco/fio

 server.c | 21 ++++++++++++++++++---
 1 file changed, 18 insertions(+), 3 deletions(-)

---

Diff of recent changes:

diff --git a/server.c b/server.c
index 42eaa4b1..859a401b 100644
--- a/server.c
+++ b/server.c
@@ -2565,6 +2565,7 @@ static int write_pid(pid_t pid, const char *pidfile)
  */
 int fio_start_server(char *pidfile)
 {
+	FILE *file;
 	pid_t pid;
 	int ret;
 
@@ -2597,14 +2598,28 @@ int fio_start_server(char *pidfile)
 	setsid();
 	openlog("fio", LOG_NDELAY|LOG_NOWAIT|LOG_PID, LOG_USER);
 	log_syslog = true;
-	close(STDIN_FILENO);
-	close(STDOUT_FILENO);
-	close(STDERR_FILENO);
+
+	file = freopen("/dev/null", "r", stdin);
+	if (!file)
+		perror("freopen");
+
+	file = freopen("/dev/null", "w", stdout);
+	if (!file)
+		perror("freopen");
+
+	file = freopen("/dev/null", "w", stderr);
+	if (!file)
+		perror("freopen");
+
 	f_out = NULL;
 	f_err = NULL;
 
 	ret = fio_server();
 
+	fclose(stdin);
+	fclose(stdout);
+	fclose(stderr);
+
 	closelog();
 	unlink(pidfile);
 	free(pidfile);



[Index of Archives]     [Linux Kernel]     [Linux SCSI]     [Linux IDE]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux