]> git.proxmox.com Git - mirror_ovs.git/commitdiff
windows: add includes to daemon-windows
authorAlin Serdean <aserdean@cloudbasesolutions.com>
Mon, 22 May 2017 11:56:50 +0000 (11:56 +0000)
committerBen Pfaff <blp@ovn.org>
Thu, 25 May 2017 21:34:04 +0000 (14:34 -0700)
Add fatal-signal.h include since it uses: fatal_signal_atexit_handler
and fatal_signal_add_hook

Use the defined getpid() function and also include <unistd.h> since
it is defined in include/windows/unistd.h .

Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
lib/daemon-windows.c

index 4fc97a84f045f43ab94792b59d31c7c0bdc8614d..55545f8ec0fdf8c2d36b3c69b3c974973f7589b2 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 Nicira, Inc.
+ * Copyright (c) 2014, 2017 Nicira, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -20,7 +20,9 @@
 #include <stdio.h>
 #include <io.h>
 #include <stdlib.h>
+#include <unistd.h>
 #include "dirs.h"
+#include "fatal-signal.h"
 #include "ovs-thread.h"
 #include "poll-loop.h"
 #include "openvswitch/vlog.h"
@@ -475,7 +477,7 @@ make_pidfile(void)
 
     fatal_signal_add_hook(unlink_pidfile, NULL, NULL, true);
 
-    fprintf(filep_pidfile, "%d\n", _getpid());
+    fprintf(filep_pidfile, "%ld\n", (long int) getpid());
     if (fflush(filep_pidfile) == EOF) {
         VLOG_FATAL("Failed to write into the pidfile %s", pidfile);
     }