#ifndef _WIN32
static int background;
static int use_syslog = 0;
-static FILE *pid_fp = NULL;
+int wrote_pid = 0;
static char *pidfile = NULL;
#endif
static int do_passphrase_from_fsid;
}
#ifndef _WIN32
-static FILE *background_self(struct openconnect_info *vpninfo, char *pidfile) {
+static int background_self(struct openconnect_info *vpninfo, char *pidfile) {
FILE *fp = NULL;
int pid;
}
if (fp)
fclose(fp);
- return fp;
+ return !!fp;
}
#endif /* _WIN32 */
print_connection_info(vpninfo);
#ifndef _WIN32
if (background)
- pid_fp = background_self(vpninfo, pidfile);
+ wrote_pid = background_self(vpninfo, pidfile);
#ifndef __native_client__
if (use_syslog) {
}
#ifndef _WIN32
- if (pid_fp)
+ if (wrote_pid)
unlink(pidfile);
#endif