bozo: do not exit when the client config already exists
authorMichael Meffie <mmeffie@sinenomine.net>
Wed, 21 Jan 2015 19:58:35 +0000 (14:58 -0500)
committerBenjamin Kaduk <kaduk@mit.edu>
Wed, 4 Feb 2015 20:32:46 +0000 (15:32 -0500)
The bosserver creates symlinks for the client CSDB and ThisCell config
files during initialization.  Avoid exiting if the client CSDB or
ThisCell configuration already exists, otherwise the bosserver cannot be
restarted with bos restart.

This fixes an error introduced with commit
720363fa9bf7cfbebdc485104b74ca6bac1895f6, Fix unchecked return values.

Change-Id: Ie6ecf126d1ed663f161c26da2a8c4d568369d99d
Reviewed-on: http://gerrit.openafs.org/11684
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Perry Ruiter <pruiter@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>

src/bozo/bosserver.c

index ca85c22..fa56807 100644 (file)
@@ -283,11 +283,17 @@ CreateDirs(const char *coredir)
        return errno;
 
     if (symlink(AFSDIR_SERVER_THISCELL_FILEPATH,
-           AFSDIR_CLIENT_THISCELL_FILEPATH))
-       return errno;
+           AFSDIR_CLIENT_THISCELL_FILEPATH)) {
+       if (errno != EEXIST) {
+           return errno;
+       }
+    }
     if (symlink(AFSDIR_SERVER_CELLSERVDB_FILEPATH,
-           AFSDIR_CLIENT_CELLSERVDB_FILEPATH))
-       return errno;
+           AFSDIR_CLIENT_CELLSERVDB_FILEPATH)) {
+       if (errno != EEXIST) {
+           return errno;
+       }
+    }
 #endif /* AFS_NT40_ENV */
     if (coredir) {
        if (MakeDir(coredir))