]> git.sesse.net Git - vlc/blobdiff - compat/getpid.c
shine: avoid double free
[vlc] / compat / getpid.c
index e5d9315d12c903bd3fbf62d0925222733aa1620c..d6275e7df357a854e6c59ab7d3854fd0c729cfdc 100644 (file)
@@ -1,21 +1,21 @@
 /*****************************************************************************
  * getpid.c: POSIX getpid() replacement
  *****************************************************************************
- * Copyright © 2009 the VideoLAN project
+ * Copyright © 2009 VLC authors and VideoLAN
  *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation; either version 2.1 of the License, or
  * (at your option) any later version.
  *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
  *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
 
 #ifdef HAVE_CONFIG_H
 #endif
 
 #include <sys/types.h>
-#ifdef WIN32
+#ifdef _WIN32
 # include <windows.h>
 #endif
 
 pid_t getpid (void)
 {
-#ifdef WIN32
+#if defined (_WIN32)
     return (pid_t) GetCurrentProcessId ();
+#elif defined (__native_client__)
+    return 1;
 #else
 # error Unimplemented!
 #endif