From: Ronnie Sahlberg Date: Sun, 3 Jun 2007 08:59:27 +0000 (+1000) Subject: print an error message to stdout if we failed to open the logfile for X-Git-Tag: tevent-0.9.20~348^2~2583^2~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=817580475798cff17392eaa6d0d9ed5e2e6e328f;p=thirdparty%2Fsamba.git print an error message to stdout if we failed to open the logfile for the daemon (This used to be ctdb commit fca953b1a3f3d6bf18264ecda1c75c68b60e2008) --- diff --git a/ctdb/common/ctdb.c b/ctdb/common/ctdb.c index 4464bef9c72..b54fb312c99 100644 --- a/ctdb/common/ctdb.c +++ b/ctdb/common/ctdb.c @@ -52,12 +52,13 @@ int ctdb_set_logfile(struct ctdb_context *ctdb, const char *logfile) ctdb->logfile = talloc_strdup(ctdb, logfile); if (ctdb->logfile != NULL && strcmp(logfile, "-") != 0) { int fd; - close(1); - close(2); fd = open(ctdb->logfile, O_WRONLY|O_APPEND|O_CREAT, 0666); if (fd == -1) { + printf("Failed to open logfile %s\n", ctdb->logfile); abort(); } + close(1); + close(2); if (fd != 1) { dup2(fd, 1); close(fd);