]> granicus.if.org Git - apache/commitdiff
get rid of a bogus use of perror()
authorJeff Trawick <trawick@apache.org>
Tue, 9 Jan 2001 04:09:43 +0000 (04:09 +0000)
committerJeff Trawick <trawick@apache.org>
Tue, 9 Jan 2001 04:09:43 +0000 (04:09 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87623 13f79535-47bb-0310-9956-ffa450edef68

support/htdigest.c

index 9bdbe8d00c7b45ce0c08153cb4519a7ce01db9b8..3162fdc255265b0c5f230e7ae529d828ee69d31f 100644 (file)
@@ -251,10 +251,13 @@ int main(int argc, char *argv[])
     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]);