Lint part 1, unused variables, routines, and return codes.
This commit is contained in:
@@ -231,8 +231,7 @@ char *argv[];
|
||||
u.ux = 0; /* prevent flush_screen() */
|
||||
|
||||
/* chdir shouldn't be called before this point to keep the
|
||||
* code parallel to other ports which call gethdate just
|
||||
* before here.
|
||||
* code parallel to other ports.
|
||||
*/
|
||||
#ifdef CHDIR
|
||||
chdirx(hackdir,1);
|
||||
|
||||
@@ -33,62 +33,6 @@ static struct stat hbuf;
|
||||
static int NDECL(eraseoldlocks);
|
||||
#endif
|
||||
|
||||
void
|
||||
gethdate(name)
|
||||
char *name;
|
||||
{
|
||||
# ifdef WANT_GETHDATE
|
||||
#if 0
|
||||
/* old version - for people short of space */
|
||||
|
||||
register char *np;
|
||||
if(stat(name, &hbuf))
|
||||
error("Cannot get status of %s.",
|
||||
(np = rindex(name, '/')) ? np+1 : name);
|
||||
#endif
|
||||
/* version using PATH from: seismo!gregc@ucsf-cgl.ARPA (Greg Couch) */
|
||||
|
||||
/*
|
||||
* The problem with #include <sys/param.h> is that this include file
|
||||
* does not exist on all systems, and moreover, that it sometimes includes
|
||||
* <sys/types.h> again, so that the compiler sees these typedefs twice.
|
||||
*/
|
||||
#define MAXPATHLEN 1024
|
||||
|
||||
register char *np, *path;
|
||||
char filename[MAXPATHLEN+1], *getenv();
|
||||
int pathlen;
|
||||
|
||||
if (index(name, '/') != (char *)0 || (path = getenv("PATH")) == (char *)0)
|
||||
path = "";
|
||||
|
||||
for (;;) {
|
||||
if ((np = index(path, ':')) == (char *)0)
|
||||
np = path + strlen(path); /* point to end str */
|
||||
pathlen = np - path;
|
||||
if (pathlen > MAXPATHLEN)
|
||||
pathlen = MAXPATHLEN;
|
||||
if (pathlen <= 1) { /* %% */
|
||||
(void) strncpy(filename, name, MAXPATHLEN);
|
||||
} else {
|
||||
(void) strncpy(filename, path, pathlen);
|
||||
filename[pathlen] = '/';
|
||||
(void) strncpy(filename + pathlen + 1, name,
|
||||
(MAXPATHLEN - 1) - pathlen);
|
||||
}
|
||||
filename[MAXPATHLEN] = '\0';
|
||||
if (stat(filename, &hbuf) == 0)
|
||||
return;
|
||||
if (*np == '\0')
|
||||
path = "";
|
||||
path = np + 1;
|
||||
}
|
||||
if (strlen(name) > BUFSZ/2)
|
||||
name = name + strlen(name) - BUFSZ/2;
|
||||
error("Cannot get status of %s.", (np = rindex(name, '/')) ? np+1 : name);
|
||||
# endif /* WANT_GETHDATE */
|
||||
}
|
||||
|
||||
#if 0
|
||||
int
|
||||
uptodate(fd)
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
#ifdef GETRES_SUPPORT
|
||||
|
||||
#if defined(LINUX)
|
||||
# if defined(LINUX)
|
||||
|
||||
static _syscall3(int, getresuid, unsigned short *, ruid, \
|
||||
unsigned short *, euid, unsigned short *, suid)
|
||||
@@ -55,9 +55,10 @@ gid_t *rgid, *egid, *sgid;
|
||||
return retval;
|
||||
}
|
||||
|
||||
#elif defined(BSD) || defined(SVR4)
|
||||
# else
|
||||
# if defined(BSD) || defined(SVR4)
|
||||
|
||||
#ifdef SYS_getresuid
|
||||
# ifdef SYS_getresuid
|
||||
|
||||
static int
|
||||
real_getresuid(ruid, euid, suid)
|
||||
@@ -66,7 +67,7 @@ uid_t *ruid, *euid, *suid;
|
||||
return syscall(SYS_getresuid, ruid, euid, suid);
|
||||
}
|
||||
|
||||
#else /* SYS_getresuid */
|
||||
# else /* SYS_getresuid */
|
||||
|
||||
static int
|
||||
real_getresuid(ruid, euid, suid)
|
||||
@@ -88,9 +89,9 @@ uid_t *ruid, *euid, *suid;
|
||||
return retval;
|
||||
}
|
||||
|
||||
#endif /* SYS_getresuid */
|
||||
# endif /* SYS_getresuid */
|
||||
|
||||
#ifdef SYS_getresgid
|
||||
# ifdef SYS_getresgid
|
||||
|
||||
static int
|
||||
real_getresgid(rgid, egid, sgid)
|
||||
@@ -99,7 +100,7 @@ gid_t *rgid, *egid, *sgid;
|
||||
return syscall(SYS_getresgid, rgid, egid, sgid);
|
||||
}
|
||||
|
||||
#else /* SYS_getresgid */
|
||||
# else /* SYS_getresgid */
|
||||
|
||||
static int
|
||||
real_getresgid(rgid, egid, sgid)
|
||||
@@ -121,8 +122,9 @@ gid_t *rgid, *egid, *sgid;
|
||||
return retval;
|
||||
}
|
||||
|
||||
#endif /* SYS_getresgid */
|
||||
#endif /* LINUX || BSD || SVR4 */
|
||||
# endif /* SYS_getresgid */
|
||||
# endif /* BSD || SVR4 */
|
||||
# endif /* LINUX */
|
||||
|
||||
static unsigned int hiding_privileges = 0;
|
||||
|
||||
@@ -199,11 +201,13 @@ nh_getegid()
|
||||
|
||||
#else /* GETRES_SUPPORT */
|
||||
|
||||
# ifdef GNOME_GRAPHICS
|
||||
int
|
||||
hide_privileges(flag)
|
||||
boolean flag;
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
# endif
|
||||
|
||||
#endif /* GETRES_SUPPORT */
|
||||
|
||||
Reference in New Issue
Block a user