Permalink
Browse files

o don't trip if PID file cannot be written.

  • Loading branch information...
1 parent cbf02d7 commit 3b4edf66a0438a5507884cc2669207051b87cd33 @hzeller committed Oct 26, 2012
Showing with 4 additions and 2 deletions.
  1. +4 −2 folve-main.cc
View
@@ -234,8 +234,10 @@ static int folve_fgetattr(const char *path, struct stat *result,
static void *folve_init(struct fuse_conn_info *conn) {
if (folve_rt.pid_file) {
FILE *p = fopen(folve_rt.pid_file, "w+");
- fprintf(p, "%d\n", getpid());
- fclose(p);
+ if (p) {
+ fprintf(p, "%d\n", getpid());
+ fclose(p);
+ }
}
const int ident_len = 20;
char *ident = (char*) malloc(ident_len); // openlog() keeps reference. Leaks.

0 comments on commit 3b4edf6

Please sign in to comment.