Skip to content

Commit 4c573f8

Browse files
CendioOssmanLMattsson
authored andcommitted
Handle existing config directory in vncpasswd
This fixes commit a79c33d. (cherry picked from commit 445e023)
1 parent 0d2e46e commit 4c573f8

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

unix/vncpasswd/vncpasswd.cxx

+4-2
Original file line numberDiff line numberDiff line change
@@ -163,8 +163,10 @@ int main(int argc, char** argv)
163163
exit(1);
164164
}
165165
if (os::mkdir_p(configDir, 0777) == -1) {
166-
fprintf(stderr, "Could not create VNC config directory: %s\n", strerror(errno));
167-
exit(1);
166+
if (errno != EEXIST) {
167+
fprintf(stderr, "Could not create VNC config directory: %s\n", strerror(errno));
168+
exit(1);
169+
}
168170
}
169171
snprintf(fname, sizeof(fname), "%s/passwd", configDir);
170172
}

0 commit comments

Comments
 (0)