Fix some #if vs. #ifdef and remove an extraneous semicolon.
Bug #624; from Daniel Richard G.
This commit is contained in:
@@ -56,7 +56,7 @@
|
||||
#else
|
||||
# include "compat/stdbool.h"
|
||||
#endif
|
||||
#if TIME_WITH_SYS_TIME
|
||||
#ifdef TIME_WITH_SYS_TIME
|
||||
# include <time.h>
|
||||
#endif
|
||||
#ifndef HAVE_STRUCT_TIMESPEC
|
||||
@@ -115,7 +115,7 @@ lock_file(int fd, int lockit)
|
||||
}
|
||||
debug_return_bool(lockf(fd, op, 0) == 0);
|
||||
}
|
||||
#elif HAVE_FLOCK
|
||||
#elif defined(HAVE_FLOCK)
|
||||
bool
|
||||
lock_file(int fd, int lockit)
|
||||
{
|
||||
|
@@ -62,7 +62,7 @@
|
||||
#include "missing.h"
|
||||
|
||||
/* We need access to h_errno to map errors from gethostbyname. */
|
||||
#if !HAVE_DECL_H_ERRNO
|
||||
#ifndef HAVE_DECL_H_ERRNO
|
||||
extern int h_errno;
|
||||
#endif
|
||||
|
||||
@@ -86,7 +86,7 @@ extern int h_errno;
|
||||
* with the system version. Note that we don't rename the structures and
|
||||
* constants, but that should be okay (except possibly for gai_strerror).
|
||||
*/
|
||||
#if TESTING
|
||||
#ifdef TESTING
|
||||
# define gai_strerror test_gai_strerror
|
||||
# define freeaddrinfo test_freeaddrinfo
|
||||
# define getaddrinfo test_getaddrinfo
|
||||
@@ -100,7 +100,7 @@ int test_getaddrinfo(const char *, const char *, const struct addrinfo *,
|
||||
* If the native platform doesn't support AI_NUMERICSERV or AI_NUMERICHOST,
|
||||
* pick some other values for them.
|
||||
*/
|
||||
#if TESTING
|
||||
#ifdef TESTING
|
||||
# if AI_NUMERICSERV == 0
|
||||
# undef AI_NUMERICSERV
|
||||
# define AI_NUMERICSERV 0x0080
|
||||
@@ -115,7 +115,7 @@ int test_getaddrinfo(const char *, const char *, const struct addrinfo *,
|
||||
* Value representing all of the hint flags set. Linux uses flags up to
|
||||
* 0x0400, so be sure not to break when testing on that platform.
|
||||
*/
|
||||
#if TESTING
|
||||
#ifdef TESTING
|
||||
# ifdef HAVE_GETADDRINFO
|
||||
# define AI_INTERNAL_ALL 0x04ff
|
||||
# else
|
||||
|
@@ -34,7 +34,7 @@
|
||||
#ifdef HAVE_UNISTD_H
|
||||
# include <unistd.h>
|
||||
#endif /* HAVE_UNISTD_H */
|
||||
#if TIME_WITH_SYS_TIME
|
||||
#ifdef TIME_WITH_SYS_TIME
|
||||
# include <time.h>
|
||||
#endif
|
||||
|
||||
|
@@ -22,7 +22,7 @@
|
||||
#include <sys/types.h>
|
||||
#include <sys/time.h>
|
||||
#include <stdio.h>
|
||||
#if TIME_WITH_SYS_TIME
|
||||
#ifdef TIME_WITH_SYS_TIME
|
||||
# include <time.h>
|
||||
#endif
|
||||
|
||||
|
@@ -2179,7 +2179,7 @@ AC_CHECK_TYPE([sig_atomic_t], [], [AC_DEFINE(sig_atomic_t, int)], [#include <sys
|
||||
AC_CHECK_TYPES([sigaction_t], [], [], [#include <sys/types.h>
|
||||
#include <signal.h>])
|
||||
AC_CHECK_TYPES([struct timespec], [], [], [#include <sys/types.h>
|
||||
#if TIME_WITH_SYS_TIME
|
||||
#ifdef TIME_WITH_SYS_TIME
|
||||
# include <sys/time.h>
|
||||
#endif
|
||||
#include <time.h>])
|
||||
|
@@ -38,7 +38,7 @@
|
||||
# include <strings.h>
|
||||
#endif /* HAVE_STRINGS_H */
|
||||
#include <limits.h>
|
||||
#if TIME_WITH_SYS_TIME
|
||||
#ifdef TIME_WITH_SYS_TIME
|
||||
# include <time.h>
|
||||
#endif
|
||||
#ifndef __linux__
|
||||
|
@@ -41,7 +41,7 @@
|
||||
#ifdef HAVE_UNISTD_H
|
||||
# include <unistd.h>
|
||||
#endif /* HAVE_UNISTD_H */
|
||||
#if TIME_WITH_SYS_TIME
|
||||
#ifdef TIME_WITH_SYS_TIME
|
||||
# include <time.h>
|
||||
#endif
|
||||
#include <errno.h>
|
||||
|
@@ -46,7 +46,7 @@
|
||||
#ifdef HAVE_STRINGS_H
|
||||
# include <strings.h>
|
||||
#endif /* HAVE_STRINGS_H */
|
||||
#if TIME_WITH_SYS_TIME
|
||||
#ifdef TIME_WITH_SYS_TIME
|
||||
# include <time.h>
|
||||
#endif
|
||||
#include <ctype.h>
|
||||
|
@@ -34,7 +34,7 @@
|
||||
#ifdef HAVE_STRINGS_H
|
||||
# include <strings.h>
|
||||
#endif /* HAVE_STRINGS_H */
|
||||
#if TIME_WITH_SYS_TIME
|
||||
#ifdef TIME_WITH_SYS_TIME
|
||||
# include <time.h>
|
||||
#endif
|
||||
#include <ctype.h>
|
||||
|
@@ -37,7 +37,7 @@
|
||||
#ifdef HAVE_UNISTD_H
|
||||
# include <unistd.h>
|
||||
#endif /* HAVE_UNISTD_H */
|
||||
#if TIME_WITH_SYS_TIME
|
||||
#ifdef TIME_WITH_SYS_TIME
|
||||
# include <time.h>
|
||||
#endif
|
||||
#ifdef HAVE_DLOPEN
|
||||
|
@@ -37,7 +37,7 @@
|
||||
#ifdef HAVE_UNISTD_H
|
||||
# include <unistd.h>
|
||||
#endif /* HAVE_UNISTD_H */
|
||||
#if TIME_WITH_SYS_TIME
|
||||
#ifdef TIME_WITH_SYS_TIME
|
||||
# include <time.h>
|
||||
#endif
|
||||
#include <errno.h>
|
||||
|
@@ -39,7 +39,7 @@
|
||||
#ifdef HAVE_UNISTD_H
|
||||
# include <unistd.h>
|
||||
#endif /* HAVE_UNISTD_H */
|
||||
#if TIME_WITH_SYS_TIME
|
||||
#ifdef TIME_WITH_SYS_TIME
|
||||
# include <time.h>
|
||||
#endif
|
||||
#include <ctype.h>
|
||||
|
@@ -61,7 +61,7 @@
|
||||
bool sudoers_setlocale(int newlocale, int *prevlocale);
|
||||
int sudoers_getlocale(void);
|
||||
void audit_success(char *exec_args[]);
|
||||
void audit_failure(char *exec_args[], char const *const fmt, ...) __printflike(2, 3);;
|
||||
void audit_failure(char *exec_args[], char const *const fmt, ...) __printflike(2, 3);
|
||||
void log_allowed(int status);
|
||||
void log_auth_failure(int status, int tries);
|
||||
void log_denial(int status, bool inform_user);
|
||||
|
@@ -40,7 +40,7 @@
|
||||
#ifdef HAVE_UNISTD_H
|
||||
# include <unistd.h>
|
||||
#endif /* HAVE_UNISTD_H */
|
||||
#if TIME_WITH_SYS_TIME
|
||||
#ifdef TIME_WITH_SYS_TIME
|
||||
# include <time.h>
|
||||
#endif
|
||||
#ifdef HAVE_DLOPEN
|
||||
|
@@ -43,7 +43,7 @@
|
||||
#ifdef HAVE_UNISTD_H
|
||||
# include <unistd.h>
|
||||
#endif /* HAVE_UNISTD_H */
|
||||
#if TIME_WITH_SYS_TIME
|
||||
#ifdef TIME_WITH_SYS_TIME
|
||||
# include <time.h>
|
||||
#endif
|
||||
#ifndef HAVE_STRUCT_TIMESPEC
|
||||
|
@@ -45,7 +45,7 @@
|
||||
#ifdef HAVE_UNISTD_H
|
||||
# include <unistd.h>
|
||||
#endif /* HAVE_UNISTD_H */
|
||||
#if TIME_WITH_SYS_TIME
|
||||
#ifdef TIME_WITH_SYS_TIME
|
||||
# include <time.h>
|
||||
#endif
|
||||
#include <errno.h>
|
||||
|
@@ -67,7 +67,7 @@
|
||||
#include <fcntl.h>
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/inet.h>
|
||||
#if TIME_WITH_SYS_TIME
|
||||
#ifdef TIME_WITH_SYS_TIME
|
||||
# include <time.h>
|
||||
#endif
|
||||
#ifdef HAVE_GETOPT_LONG
|
||||
|
@@ -40,7 +40,7 @@
|
||||
#ifdef HAVE_UNISTD_H
|
||||
# include <unistd.h>
|
||||
#endif /* HAVE_UNISTD_H */
|
||||
#if TIME_WITH_SYS_TIME
|
||||
#ifdef TIME_WITH_SYS_TIME
|
||||
# include <time.h>
|
||||
#endif
|
||||
#include <errno.h>
|
||||
|
@@ -42,7 +42,7 @@
|
||||
#ifdef HAVE_UNISTD_H
|
||||
# include <unistd.h>
|
||||
#endif /* HAVE_UNISTD_H */
|
||||
#if TIME_WITH_SYS_TIME
|
||||
#ifdef TIME_WITH_SYS_TIME
|
||||
# include <time.h>
|
||||
#endif
|
||||
#include <errno.h>
|
||||
|
@@ -16,7 +16,7 @@
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#if HAVE_GSS_KRB5_CCACHE_NAME
|
||||
#ifdef HAVE_GSS_KRB5_CCACHE_NAME
|
||||
# if defined(HAVE_GSSAPI_GSSAPI_KRB5_H)
|
||||
# include <gssapi/gssapi.h>
|
||||
# include <gssapi/gssapi_krb5.h>
|
||||
|
@@ -54,7 +54,7 @@
|
||||
#include <signal.h>
|
||||
#include <grp.h>
|
||||
#include <pwd.h>
|
||||
#if TIME_WITH_SYS_TIME
|
||||
#ifdef TIME_WITH_SYS_TIME
|
||||
# include <time.h>
|
||||
#endif
|
||||
#ifdef HAVE_LOGIN_CAP_H
|
||||
@@ -991,7 +991,7 @@ exec_setup(struct command_details *details, const char *ptyname, int ptyfd)
|
||||
details->euid);
|
||||
goto done;
|
||||
}
|
||||
#elif HAVE_SETREUID
|
||||
#elif defined(HAVE_SETREUID)
|
||||
if (setreuid(details->uid, details->euid) != 0) {
|
||||
warning(_("unable to change to runas uid (%u, %u)"),
|
||||
(unsigned int)details->uid, (unsigned int)details->euid);
|
||||
|
@@ -45,7 +45,7 @@
|
||||
#include <signal.h>
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#if TIME_WITH_SYS_TIME
|
||||
#ifdef TIME_WITH_SYS_TIME
|
||||
# include <time.h>
|
||||
#endif
|
||||
|
||||
|
@@ -458,7 +458,7 @@ get_process_ttyname(void)
|
||||
|
||||
debug_return_str(tty);
|
||||
}
|
||||
#elif HAVE_PSTAT_GETPROC
|
||||
#elif defined(HAVE_PSTAT_GETPROC)
|
||||
/*
|
||||
* Return a string from ttyname() containing the tty to which the process is
|
||||
* attached or NULL if the process has no controlling tty.
|
||||
|
@@ -40,7 +40,7 @@
|
||||
#ifdef HAVE_UNISTD_H
|
||||
# include <unistd.h>
|
||||
#endif /* HAVE_UNISTD_H */
|
||||
#if TIME_WITH_SYS_TIME
|
||||
#ifdef TIME_WITH_SYS_TIME
|
||||
# include <time.h>
|
||||
#endif
|
||||
#ifdef HAVE_UTMPX_H
|
||||
|
Reference in New Issue
Block a user