Clean up miscellaneous small stuff:
* unifdef lint
* unifdef S_IFLNK, S_ISFIFO, S_ISLNK, S_ISSOCK, O_APPEND
* unif(def) 0, NOTUSED, notdef -- untouched since original import
* unifdef IIASA
No binary changes.
ok?
Index: csh.c
===================================================================
RCS file: /cvs/src/bin/csh/csh.c,v
retrieving revision 1.32
diff -u -p -r1.32 csh.c
--- csh.c 26 Oct 2015 16:27:04 -0000 1.32
+++ csh.c 26 Oct 2015 16:53:38 -0000
@@ -1285,11 +1285,6 @@ defaultpath(void)
#undef DIRAPPEND
-#if 0
- if (euid != 0 && uid != 0)
- *blkp++ = Strsave(STRdot);
-#endif
-
*blkp = NULL;
return (blk);
}
Index: exp.c
===================================================================
RCS file: /cvs/src/bin/csh/exp.c,v
retrieving revision 1.13
diff -u -p -r1.13 exp.c
--- exp.c 26 Oct 2015 15:01:15 -0000 1.13
+++ exp.c 26 Oct 2015 16:53:38 -0000
@@ -503,10 +503,7 @@ exp6(Char ***vp, bool ignore)
break;
default:
- if (
-#ifdef S_IFLNK
- cp[1] == 'l' ? lstat(short2str(ep), &stb) :
-#endif
+ if (cp[1] == 'l' ? lstat(short2str(ep), &stb) :
stat(short2str(ep), &stb)) {
xfree(ep);
return (Strsave(STR0));
@@ -522,27 +519,15 @@ exp6(Char ***vp, bool ignore)
break;
case 'p':
-#ifdef S_ISFIFO
i = S_ISFIFO(stb.st_mode);
-#else
- i = 0;
-#endif
break;
case 'l':
-#ifdef S_ISLNK
i = S_ISLNK(stb.st_mode);
-#else
- i = 0;
-#endif
break;
case 's':
-#ifdef S_ISSOCK
i = S_ISSOCK(stb.st_mode);
-#else
- i = 0;
-#endif
break;
case 'z':
Index: glob.c
===================================================================
RCS file: /cvs/src/bin/csh/glob.c,v
retrieving revision 1.19
diff -u -p -r1.19 glob.c
--- glob.c 26 Oct 2015 15:01:15 -0000 1.19
+++ glob.c 26 Oct 2015 16:53:38 -0000
@@ -579,9 +579,6 @@ dobackp(Char *cp, bool literal)
Char *ep, word[PATH_MAX];
if (pargv) {
-#ifdef notdef
- abort();
-#endif
blkfree(pargv);
}
pargsiz = GLOBSPACE;
Index: lex.c
===================================================================
RCS file: /cvs/src/bin/csh/lex.c,v
retrieving revision 1.19
diff -u -p -r1.19 lex.c
--- lex.c 17 Jun 2015 03:59:12 -0000 1.19
+++ lex.c 26 Oct 2015 16:53:39 -0000
@@ -445,15 +445,6 @@ getdol(void)
default:
toolong = 0;
if (Isdigit(c)) {
-#ifdef notdef
- /* let $?0 pass for now */
- if (special) {
- seterror(ERR_DIGIT);
- *np = 0;
- addla(name);
- return;
- }
-#endif
/* we know that np < &name[4] */
ep = &np[MAXVARLEN];
while ((c = getC(DOEXCL)) != '\0'){
@@ -750,13 +741,6 @@ getsub(struct wordent *en)
}
(void) Strlcpy(lhsb, slhs, sizeof(lhsb)/sizeof(Char));
break;
-
-#ifdef notdef
- case '~':
- if (lhsb[0] == 0)
- goto badlhs;
- break;
-#endif
case 's':
delim = getC(0);
Index: misc.c
===================================================================
RCS file: /cvs/src/bin/csh/misc.c,v
retrieving revision 1.16
diff -u -p -r1.16 misc.c
--- misc.c 26 Oct 2015 15:01:15 -0000 1.16
+++ misc.c 26 Oct 2015 16:53:39 -0000
@@ -139,24 +139,6 @@ saveblk(Char **v)
return (onewv);
}
-#ifdef NOTUSED
-char *
-strstr(char *s, char *t)
-{
- do {
- char *ss = s;
- char *tt = t;
-
- do
- if (*tt == '\0')
- return (s);
- while (*ss++ == *tt++);
- } while (*s++ != '\0');
- return (NULL);
-}
-
-#endif /* NOTUSED */
-
Char **
blkspl(Char **up, Char **vp)
{
Index: proc.c
===================================================================
RCS file: /cvs/src/bin/csh/proc.c,v
retrieving revision 1.27
diff -u -p -r1.27 proc.c
--- proc.c 18 Apr 2015 18:28:36 -0000 1.27
+++ proc.c 26 Oct 2015 16:53:39 -0000
@@ -160,9 +160,6 @@ found:
pclrcurr(fp);
if (jobflags & PFOREGND) {
if (jobflags & (PSIGNALED | PSTOPPED | PPTIME) ||
-#ifdef IIASA
- jobflags & PAEXITED ||
-#endif
!eq(dcwd->di_name, fp->p_cwd->di_name)) {
; /* print in pjwait */
}
Index: sem.c
===================================================================
RCS file: /cvs/src/bin/csh/sem.c,v
retrieving revision 1.19
diff -u -p -r1.19 sem.c
--- sem.c 8 Feb 2015 05:47:28 -0000 1.19
+++ sem.c 26 Oct 2015 16:53:39 -0000
@@ -562,12 +562,7 @@ doio(struct command *t, int *pipein, int
(void) dcopy(SHOUT, 1);
(void) dcopy(SHERR, 2);
if ((flags & F_APPEND) &&
-#ifdef O_APPEND
(fd = open(tmp, O_WRONLY | O_APPEND)) >= 0);
-#else
- (fd = open(tmp, O_WRONLY)) >= 0)
- (void) lseek(STDOUT_FILENO, (off_t) 0, SEEK_END);
-#endif
else {
if (!(flags & F_OVERWRITE) && adrof(STRnoclobber)) {
if (flags & F_APPEND)
Index: set.c
===================================================================
RCS file: /cvs/src/bin/csh/set.c,v
retrieving revision 1.17
diff -u -p -r1.17 set.c
--- set.c 26 Oct 2015 15:01:15 -0000 1.17
+++ set.c 26 Oct 2015 16:53:39 -0000
@@ -585,11 +585,7 @@ exportpath(Char **val)
Setenv(STRPATH, exppath);
}
-#ifndef lint
- /*
- * Lint thinks these have null effect
- */
- /* macros to do single rotations on node p */
+/* macros to do single rotations on node p */
#define rright(p) (\
t = (p)->v_left,\
(t)->v_parent = (p)->v_parent,\
@@ -602,20 +598,6 @@ exportpath(Char **val)
((p)->v_right = t->v_left) ? (t->v_left->v_parent = (p)) : 0,\
(t->v_left = (p))->v_parent = t,\
(p) = t)
-#else
-struct varent *
-rleft(struct varent *p)
-{
- return (p);
-}
-struct varent *
-rright(struct varent *p)
-{
- return (p);
-}
-
-#endif /* ! lint */
-
/*
* Rebalance a tree, starting at p and up.
@@ -626,11 +608,7 @@ static void
balance(struct varent *p, int f, int d)
{
struct varent *pp;
-
-#ifndef lint
struct varent *t; /* used by the rotate macros */
-
-#endif
int ff;
/*
--
Christian "naddy" Weisgerber [email protected]