You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by tr...@apache.org on 2001/01/09 05:09:43 UTC

cvs commit: httpd-2.0/support htdigest.c

trawick     01/01/08 20:09:43

  Modified:    support  htdigest.c
  Log:
  get rid of a bogus use of perror()
  
  Revision  Changes    Path
  1.19      +7 -4      httpd-2.0/support/htdigest.c
  
  Index: htdigest.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/support/htdigest.c,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- htdigest.c	2000/12/21 21:00:44	1.18
  +++ htdigest.c	2001/01/09 04:09:43	1.19
  @@ -251,10 +251,13 @@
       if (argc == 5) {
   	if (strcmp(argv[1], "-c"))
   	    usage();
  -	if (apr_open(&tfp, argv[2], APR_WRITE | APR_CREATE, -1, cntxt) != APR_SUCCESS) {
  -	    fprintf(stderr, "Could not open passwd file %s for writing.\n",
  -		    argv[2]);
  -	    perror("apr_open");
  +	rv = apr_open(&tfp, argv[2], APR_WRITE | APR_CREATE, -1, cntxt);
  +        if (rv != APR_SUCCESS) {
  +            char errmsg[120];
  +
  +	    fprintf(stderr, "Could not open passwd file %s for writing: %s\n",
  +		    argv[2],
  +                    apr_strerror(rv, errmsg, sizeof errmsg));
   	    exit(1);
   	}
   	printf("Adding password for %s in realm %s.\n", argv[4], argv[3]);