From b2338c1a6d1e57f01396a8e77c65734cb2f0ae17 Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Wed, 30 May 2018 14:12:16 -0700 Subject: fixes #499 Eliminate the unused nni_plat_home_dir... --- src/platform/posix/posix_file.c | 13 ------------- src/platform/windows/win_file.c | 19 +------------------ 2 files changed, 1 insertion(+), 31 deletions(-) (limited to 'src/platform') diff --git a/src/platform/posix/posix_file.c b/src/platform/posix/posix_file.c index b1da3cd5..b21c0509 100644 --- a/src/platform/posix/posix_file.c +++ b/src/platform/posix/posix_file.c @@ -316,19 +316,6 @@ nni_plat_temp_dir(void) return (nni_strdup("/tmp")); } -char * -nni_plat_home_dir(void) -{ - char *home; - - // POSIX says that $HOME is *REQUIRED*. We could look in - // getpwuid, but realistically this is simply not required. - if ((home = getenv("HOME")) != NULL) { - return (nni_strdup(home)); - } - return (NULL); -} - char * nni_plat_join_dir(const char *prefix, const char *suffix) { diff --git a/src/platform/windows/win_file.c b/src/platform/windows/win_file.c index 515647e0..3b6461a6 100644 --- a/src/platform/windows/win_file.c +++ b/src/platform/windows/win_file.c @@ -273,23 +273,6 @@ nni_plat_temp_dir(void) return (nni_strdup(path)); } -char * -nni_plat_home_dir(void) -{ - char *homedrv; - char *homedir; - char *result; - - if (((homedrv = getenv("HOMEDRIVE")) == NULL) || - ((homedir = getenv("HOMEPATH")) == NULL)) { - return (NULL); - } - if (nni_asprintf(&result, "%s%s", homedrv, homedir) == 0) { - return (result); - } - return (NULL); -} - int nni_plat_file_type(const char *name, int *typep) { @@ -366,4 +349,4 @@ nni_plat_file_unlock(nni_plat_flock *lk) lk->h = INVALID_HANDLE_VALUE; } -#endif // NNG_PLATFORM_WINDOWS \ No newline at end of file +#endif // NNG_PLATFORM_WINDOWS -- cgit v1.2.3-70-g09d2