]> source.dussan.org Git - tigervnc.git/commitdiff
Handle existing config directory in vncpasswd
authorPierre Ossman <ossman@cendio.se>
Thu, 15 Aug 2024 12:24:42 +0000 (14:24 +0200)
committerLinn Mattsson <linma@cendio.se>
Fri, 18 Oct 2024 09:03:48 +0000 (11:03 +0200)
This fixes commit a79c33d.

(cherry picked from commit 445e0230cf4e939dcc59caf5d5f001c2f7b04da6)

unix/vncpasswd/vncpasswd.cxx

index 30091a3db6078aec71d688fbb6efee7a7db8c005..3587cd6ac3a5e87c488b5849a7af163b88a57764 100644 (file)
@@ -163,8 +163,10 @@ int main(int argc, char** argv)
       exit(1);
     }
     if (os::mkdir_p(configDir, 0777) == -1) {
-      fprintf(stderr, "Could not create VNC config directory: %s\n", strerror(errno));
-      exit(1);
+      if (errno != EEXIST) {
+        fprintf(stderr, "Could not create VNC config directory: %s\n", strerror(errno));
+        exit(1);
+      }
     }
     snprintf(fname, sizeof(fname), "%s/passwd", configDir);
   }