File: patch-3

package info (click to toggle)
afio 2.4.7-3
  • links: PTS
  • area: main
  • in suites: woody
  • size: 372 kB
  • ctags: 403
  • sloc: ansic: 4,238; sh: 226; makefile: 64
file content (71 lines) | stat: -rw-r--r-- 1,979 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
--- afio.c	Mon Sep 28 16:05:54 1998
+++ /home/edd/afio.c	Mon Nov 15 02:50:03 1999
@@ -109,6 +109,10 @@
      STATIC short zflag;	/* Print final statistics */
      STATIC short flag0;	/* Input names terminated with '\0' */
      STATIC short Jflag=0;	/* Keep going after archive write error */
+
+     STATIC short Nflag=0;  /* wea: Ignore TTY Flag;  */
+                            /* allow "-H promptscript" without a tty */
+
      STATIC short hidequit;	/* show the quit option? */
      STATIC short abspaths;	/* allow absolute path names? */
      STATIC uint arbsize = BLOCK;	/* Archive block size */
@@ -179,7 +183,12 @@
   /* ignore SIGPIPE to deal with gzip -d exiting prematurely */
   VOID signal (SIGPIPE, SIG_IGN);
   while (c = options (ac, av, 
-         "aioprtIOVCb:c:de:fghjklmns:uvxXy:Y:zFKZL:R:qAE:G:M:w:W:T:SBD:P:Q:U4JH:0@:N:")
+/* wea
+         "aioprtIOVCb:c:de:fghjklmns:uvxXy:Y:zFKZL:R:qAE:G:M:w:W:T:SBD:P:Q:U4JH:0@:N:"
+*/
+
+/* wea: allow -N to flag no TTY usage with -H option */
+         "aioprtNIOVCb:c:de:fghjklmns:uvxXy:Y:zFKZL:R:qAE:G:M:w:W:T:SBD:P:Q:U4JH:0@:")
         )
     {
       switch (c)
@@ -294,6 +303,11 @@
 	case 'x':
 	  xflag = 1;
 	  break;
+
+    case 'N':               /* wea */
+      Nflag = 1;
+      break;
+
 	case 'X':
 	  xflag = 0;
 	  break;
@@ -1999,7 +2013,14 @@
          and reason for calling it as arguments.
 	 the script should return 0 for ok and 1 for abort, other 
 	 return codes will be treated as errors. */
+
+/* wea */
+    if (Nflag) {
+      VOID sprintf(msg,"%s %u %s '%s' </dev/null", promptscript,arvolume,arspec,why);
+    }
+    else {
       VOID sprintf(msg,"%s %u %s '%s' <%s",promptscript,arvolume,arspec,why,TTY);
+    }
       for (;;)
       {
 	  auto int result;
@@ -2755,8 +2776,16 @@
     {
       VOID warn (TTY, syserr ());
     }
+
+
+/* wea 
   else if (!isatty (fd))
+*/
+  else if (!isatty (fd) && !Nflag)
     VOID warn (TTY, "Is not a tty");
+/* */
+
+
   return (fd);
 }