From 63d9fc6b0a4a8da306b3a257eec838d5a145f3ca Mon Sep 17 00:00:00 2001 From: "Andrew V. Samoilov" Date: Thu, 18 Jan 2018 23:54:45 +0200 Subject: [PATCH] smbfs: code cleanup * (sys_select): fix } * (sys_open): commented out * (sys_random, sys_srandom): remove unused functions Signed-off-by: Andrew V. Samoilov --- src/vfs/smbfs/helpers/lib/system.c | 41 +++--------------------------- 1 file changed, 3 insertions(+), 38 deletions(-) diff --git a/src/vfs/smbfs/helpers/lib/system.c b/src/vfs/smbfs/helpers/lib/system.c index 19c7f0fa9..9dfd7fe6b 100644 --- a/src/vfs/smbfs/helpers/lib/system.c +++ b/src/vfs/smbfs/helpers/lib/system.c @@ -103,7 +103,6 @@ sys_select (int maxfd, fd_set * fds, struct timeval *tval) #else /* !NO_SELECT */ int sys_select (int maxfd, fd_set * fds, struct timeval *tval) -/* cppcheck-suppress syntaxError */ { #ifdef USE_POLL struct pollfd pfd[256]; @@ -154,8 +153,8 @@ sys_select (int maxfd, fd_set * fds, struct timeval *tval) while (selrtn < 0 && errno == EINTR); return (selrtn); -} #endif /* USE_POLL */ +} #endif /* NO_SELECT */ /******************************************************************* @@ -197,7 +196,7 @@ sys_ftell (FILE * fp) { return (SMB_OFF_T) ftell (fp); } -#endif /* 0 */ + /******************************************************************* An open() wrapper that will deal with 64 bit filesizes. ********************************************************************/ @@ -211,6 +210,7 @@ sys_open (const char *path, int oflag, mode_t mode) /******************************************************************* An fopen() wrapper that will deal with 64 bit filesizes. ********************************************************************/ +#endif /* 0 */ FILE * sys_fopen (const char *path, const char *type) @@ -304,38 +304,3 @@ sys_gethostbyname (const char *name) return (gethostbyname (name)); #endif /* REDUCE_ROOT_DNS_LOOKUPS */ } - -/************************************************************************** - Wrapper for random(). -****************************************************************************/ -#if 0 -long -sys_random (void) -{ -#if defined(HAVE_RANDOM) - return (long) random (); -#elif defined(HAVE_RAND) - return (long) rand (); -#else - DEBUG (0, ("Error - no random function available !\n")); - exit (1); -#endif -} - -/************************************************************************** - Wrapper for srandom(). -****************************************************************************/ - -void -sys_srandom (unsigned int seed) -{ -#if defined(HAVE_SRANDOM) - srandom (seed); -#elif defined(HAVE_SRAND) - srand (seed); -#else - DEBUG (0, ("Error - no srandom function available !\n")); - exit (1); -#endif -} -#endif /* 0 */