Why should _getpid() be replaced with the other function? Thanks, Sairam
On 2/5/17, 8:41 PM, "ovs-dev-boun...@openvswitch.org on behalf of Alin Serdean" <ovs-dev-boun...@openvswitch.org on behalf of aserd...@cloudbasesolutions.com> wrote: >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 <aserd...@cloudbasesolutions.com> >--- > lib/daemon-windows.c | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) > >diff --git a/lib/daemon-windows.c b/lib/daemon-windows.c >index 7e2e9da..ccf4297 100644 >--- a/lib/daemon-windows.c >+++ b/lib/daemon-windows.c >@@ -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" >@@ -476,7 +478,7 @@ make_pidfile(void) > > fatal_signal_add_hook(unlink_pidfile, NULL, NULL, true); > >- fprintf(filep_pidfile, "%d\n", _getpid()); >+ fprintf(filep_pidfile, "%d\n", getpid()); > if (fflush(filep_pidfile) == EOF) { > VLOG_FATAL("Failed to write into the pidfile %s", pidfile); > } >-- >2.10.2.windows.1 >_______________________________________________ >dev mailing list >d...@openvswitch.org >https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.openvswitch.org_mailman_listinfo_ovs-2Ddev&d=DwICAg&c=uilaK90D4TOVoH58JNXRgQ&r=Z6vowHUOjP5ysP_g372c49Nqc1vEKqHKNBkR5Q5Z7uo&m=4bES-cJ6lfbtKBVTx_l5djCuYUzfaAv1eo2-AJJVP4I&s=g49Hk4r9F29861GqEbXLFLjyYxmJENyhOos6Tr-BEdQ&e= > _______________________________________________ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev