]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
"nsupdate -- -" now reads non-interactively from stdin
authorAndreas Gustafsson <source@isc.org>
Fri, 1 Dec 2000 20:47:15 +0000 (20:47 +0000)
committerAndreas Gustafsson <source@isc.org>
Fri, 1 Dec 2000 20:47:15 +0000 (20:47 +0000)
bin/nsupdate/nsupdate.c

index 0070a5079f9f44191eafaab6e9393dac22be8027..d525adbeecc6ab7d60379f3da0506c24c4735d02 100644 (file)
@@ -15,7 +15,7 @@
  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: nsupdate.c,v 1.68 2000/11/27 17:58:59 gson Exp $ */
+/* $Id: nsupdate.c,v 1.69 2000/12/01 20:47:15 gson Exp $ */
 
 #include <config.h>
 
@@ -574,13 +574,17 @@ parse_args(int argc, char **argv) {
        }
 
        if (argv[isc_commandline_index] != NULL) {
-               result = isc_stdio_open(argv[isc_commandline_index], "r",
-                                       &input);
-               if (result != ISC_R_SUCCESS) {
-                       fprintf(stderr, "isc_stdio_open(%s): %s\n",
-                               argv[isc_commandline_index],
-                               isc_result_totext(result));
-                       exit(1);
+               if (strcmp(argv[isc_commandline_index], "-") == 0) {
+                       input = stdin;
+               } else {
+                       result = isc_stdio_open(argv[isc_commandline_index],
+                                               "r", &input);
+                       if (result != ISC_R_SUCCESS) {
+                               fprintf(stderr, "isc_stdio_open(%s): %s\n",
+                                       argv[isc_commandline_index],
+                                       isc_result_totext(result));
+                               exit(1);
+                       }
                }
                interactive = ISC_FALSE;
        }