[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [kdelibs/frameworks] kdecore: Remove unsetenv from kdefakes
From:       Nicolas_Lécureuil <neoclust.kde () free ! fr>
Date:       2012-08-31 16:12:21
Message-ID: 20120831161221.518B6A6094 () git ! kde ! org
[Download RAW message or body]

Git commit 21b06b57d009423cfeae345f904dba6b9d0b0307 by Nicolas Lécureuil.
Committed on 31/08/2012 at 20:24.
Pushed by nlecureuil into branch 'frameworks'.

Remove unsetenv from kdefakes

M  +0    -2    kdecore/ConfigureChecks.cmake
M  +0    -55   kdecore/fakes.c
M  +0    -13   kdecore/kdefakes.h.cmake

http://commits.kde.org/kdelibs/21b06b57d009423cfeae345f904dba6b9d0b0307

diff --git a/kdecore/ConfigureChecks.cmake b/kdecore/ConfigureChecks.cmake
index 13c824a..989e8ed 100644
--- a/kdecore/ConfigureChecks.cmake
+++ b/kdecore/ConfigureChecks.cmake
@@ -36,7 +36,6 @@ check_function_exists(getmntinfo  HAVE_GETMNTINFO)
 check_function_exists(mkstemps    HAVE_MKSTEMPS)
 check_function_exists(mkstemp     HAVE_MKSTEMP)
 check_function_exists(mkstemps    HAVE_MKSTEMPS)
-check_function_exists(unsetenv    HAVE_UNSETENV)
 check_function_exists(random      HAVE_RANDOM)
 check_function_exists(seteuid     HAVE_SETEUID)
 check_function_exists(mmap        HAVE_MMAP)
@@ -64,7 +63,6 @@ check_prototype_exists(strlcat string.h             HAVE_STRLCAT_PROTO)
 check_prototype_exists(strlcpy string.h             HAVE_STRLCPY_PROTO)
 check_prototype_exists(random stdlib.h              HAVE_RANDOM_PROTO)
 check_prototype_exists(setenv stdlib.h              HAVE_SETENV_PROTO)
-check_prototype_exists(unsetenv stdlib.h            HAVE_UNSETENV_PROTO)
 check_prototype_exists(usleep unistd.h              HAVE_USLEEP_PROTO)
 check_prototype_exists(initgroups "unistd.h;sys/types.h;unistd.h;grp.h" HAVE_INITGROUPS_PROTO)
 check_prototype_exists(mkstemps "stdlib.h;unistd.h" HAVE_MKSTEMPS_PROTO)
diff --git a/kdecore/fakes.c b/kdecore/fakes.c
index 663a30b..fd703d6 100644
--- a/kdecore/fakes.c
+++ b/kdecore/fakes.c
@@ -42,61 +42,6 @@
 #define KDE_mkdir mkdir
 
 
-#if !HAVE_UNSETENV
-
-#if HAVE_ALLOCA_H
-#include <alloca.h>
-#endif
-#if HAVE_STRING_H
-#include <string.h>
-#endif
-#if HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
-#if HAVE_ERRNO_H
-#include <errno.h>
-#endif
-#if HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-
-#ifndef environ
-extern char ** environ;
-#endif
-
-KDECORE_EXPORT int unsetenv (const char *name)
-{
-  size_t len;
-  char **ep;
-
-  if (name == NULL || *name == '\0' || strchr (name, '=') != NULL)
-    {
-      errno = EINVAL;
-      return -1;
-    }
-
-  len = strlen (name);
-
-  ep = environ;
-  while (*ep != NULL)
-    if (!strncmp (*ep, name, len) && (*ep)[len] == '=')
-      {
-	/* Found it.  Remove this pointer by moving later ones back.  */
-	char **dp = ep;
-
-	do
-	  dp[0] = dp[1];
-	while (*dp++);
-	/* Continue the loop in case NAME appears again.  */
-      }
-    else
-      ++ep;
-
-  return 0;
-}
-
-#endif /* !HAVE_UNSETENV */
-
 #if ! HAVE_USLEEP
 
 #if TIME_WITH_SYS_TIME
diff --git a/kdecore/kdefakes.h.cmake b/kdecore/kdefakes.h.cmake
index 153bbef..193f0a2 100644
--- a/kdecore/kdefakes.h.cmake
+++ b/kdecore/kdefakes.h.cmake
@@ -27,7 +27,6 @@
    You should include this file in any .cpp file that uses any one of these 
    functions:
      strlcat, strlcpy, 
-     unsetenv, 
      usleep, initgroups, 
      random, srandom  (this is for KRandom itself, prefer using KRandom in any other code)
      mkdtemp (this is for KTempDir itself, prefer using KTempDir everywhere else)
@@ -80,17 +79,6 @@ void srandom(unsigned int);
 #endif
 #endif
 
-#cmakedefine01 HAVE_UNSETENV_PROTO
-#if ! HAVE_UNSETENV_PROTO
-#ifdef __cplusplus
-extern "C" {
-#endif
-int unsetenv (const char *);
-#ifdef __cplusplus
-}
-#endif
-#endif
-
 #cmakedefine01 HAVE_USLEEP_PROTO
 #if ! HAVE_USLEEP_PROTO
 #ifdef __cplusplus
@@ -170,7 +158,6 @@ int getgrouplist(const char *, gid_t , gid_t *, int *);
 #endif
 #endif
 
-#cmakedefine01 HAVE_UNSETENV
 #cmakedefine01 HAVE_ALLOCA_H
 #cmakedefine01 HAVE_STRING_H
 #cmakedefine01 HAVE_STDLIB_H
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic