]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
This commit was generated by cvs2svn to compensate for changes in r293,
authorSam Hartman <hartmans@debian.org>
Fri, 20 Jul 2001 10:07:28 +0000 (10:07 +0000)
committerSam Hartman <hartmans@debian.org>
Fri, 20 Jul 2001 10:07:28 +0000 (10:07 +0000)
which included commits to RCS files with non-trunk default branches.

src/bucoord/main.c
src/export/Makefile
src/lwp/waitkey.c

index 3df5dabd867bffdadfe02646357cca24573d28f8..3cdefd9310bb53f553f14b6bac6190f6deaa3e1d 100644 (file)
@@ -10,7 +10,7 @@
 #include <afsconfig.h>
 #include <afs/param.h>
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/bucoord/main.c,v 1.1.1.4 2001/07/14 22:20:53 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/bucoord/main.c,v 1.1.1.5 2001/07/20 10:06:30 hartmans Exp $");
 
 #include <afs/stds.h>
 #include <sys/types.h>
@@ -688,13 +688,17 @@ main(argc, argv)
     /* Iterate on command lines, interpreting user commands (interactive mode) */
     while(1) 
     {
+       int ret;
+
        printf("backup> ");
        fflush(stdout);
 
        
-       while (LWP_GetLine(lineBuffer, sizeof(lineBuffer)) == 0)
+       while ((ret = LWP_GetLine(lineBuffer, sizeof(lineBuffer))) == 0)
          printf("%s: Command line too long\n", whoami); /* line too long */
-       
+
+       if (ret == -1) return 0; /* Got EOF */
+
        if ( !LineIsBlank(lineBuffer) ) 
        {
            code = cmd_ParseLine(lineBuffer, targv, &targc, MAXV);
index 5a36eca5a538735eee4158df38494b7950fd3798..2b93f81c7b453a3ea5a255124d9d51ca220a3bc3 100644 (file)
@@ -53,14 +53,14 @@ export.ext.nonfs: export.nonfs.o symtab.o
        ${LD} -o export.ext.nonfs -eexport ${IMPORTS} export.nonfs.o symtab.o ${EXPORTS} -lcsys
 
 export.nonfs.o:
-       ${CC} -DAFS_NONFSTRANS -c export.c
+       ${CC} ${INCS} -DAFS_NONFSTRANS -c export.c
        -mv export.o export.nonfs.o
 
 cfgexport: cfgexport.o
-       ${CC} -O -o cfgexport cfgexport.o
+       ${CC} ${INCS} -O -o cfgexport cfgexport.o
 
 cfgafs: cfgafs.o
-       ${CC} -O -o cfgafs cfgafs.o
+       ${CC} ${INCS} -O -o cfgafs cfgafs.o
 
 cfgexport.o: cfgexport.c AFS_component_version_number.c
 cfgafs.o: cfgafs.c AFS_component_version_number.c
index bc109cc77195f54e464f941749de5f4cd64e70ee..54203e7a3e095fda6db96c47eabb1318bece1c6f 100644 (file)
@@ -22,7 +22,7 @@
 #include <afsconfig.h>
 #include <afs/param.h>
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/lwp/waitkey.c,v 1.1.1.6 2001/07/14 22:22:57 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/lwp/waitkey.c,v 1.1.1.7 2001/07/20 10:07:28 hartmans Exp $");
 
 #include <stdio.h>
 #include <sys/types.h>
@@ -98,6 +98,7 @@ int LWP_WaitForKeystroke(int seconds)
  * Return Value:
  *   n - a whole line has been read.(has n chars)
  *   0 - buf not big enough.
+ *   -1 - line with only EOF
  */
 
 int LWP_GetLine(char *linebuf, int len)
@@ -111,6 +112,10 @@ int LWP_GetLine(char *linebuf, int len)
     { 
       LWP_WaitForKeystroke(-1);
       ch = getch(); 
+      
+      if ((ch == EOF) && (cnt == 0))
+       return -1;
+
       if (ch == '\b') {/* print and throw away a backspace */
        if (!cnt) /* if we are at the start of the line don't bspace */
          continue;
@@ -195,15 +200,19 @@ int LWP_WaitForKeystroke(int seconds)
  * Return Value:
  *   n - a whole line has been read.(has n chars)
  *   0 - buf not big enough.
+ *   -1 - line with only EOF
  */
 
 int LWP_GetLine(char *linebuf, int len)
 {
   int linelen;
+  char *s;
 
   LWP_WaitForKeystroke(-1);
 
-  fgets(linebuf, len, stdin);
+  s = fgets(linebuf, len, stdin);
+  if (s == NULL) return -1;
+
   linelen = strlen(linebuf);
   if (linebuf[linelen-1] != '\n') /* buffer too small */
     return 0;