Print strerror when a system error occurs; add a new function rsyserr
authorMartin Pool <mbp@samba.org>
Thu, 26 Oct 2000 07:31:29 +0000 (07:31 +0000)
committerMartin Pool <mbp@samba.org>
Thu, 26 Oct 2000 07:31:29 +0000 (07:31 +0000)
to do this.  This is not used in every case yet -- I've just changed a
few cases that were causing trouble.  Please convert others as you see them.

authenticate.c

index 842a59e..9aae72d 100644 (file)
@@ -1,5 +1,6 @@
-/* 
-   Copyright (C) Andrew Tridgell 1998
+/* -*- c-file-style: "linux"; -*-
+   
+   Copyright (C) 1998-2000 by Andrew Tridgell 
    
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -144,7 +145,7 @@ static char *getpassf(char *filename)
        if (!filename) return NULL;
 
        if ( (fd=open(filename,O_RDONLY)) == -1) {
-               rprintf(FERROR,"could not open password file \"%s\"\n",filename);
+               rsyserr(FERROR, errno, "could not open password file \"%s\"",filename);
                if (envpw) rprintf(FERROR,"falling back to RSYNC_PASSWORD environment variable.\n");    
                return NULL;
        }