summaryrefslogtreecommitdiff
path: root/src/commit.c
diff options
context:
space:
mode:
authorAn-Cheng Huang <ancheng@vyatta.com>2007-10-30 10:56:58 -0700
committerAn-Cheng Huang <ancheng@vyatta.com>2007-10-30 10:56:58 -0700
commit653569b3768a4ebfc7d111864f3d165977db37a6 (patch)
treedf4c1ee8a7d237dcdc8cad5b2984b0e60cc430bc /src/commit.c
parent5c170940c89065df4c7bbc6561cbdfd297363aad (diff)
downloadvyatta-cfg-653569b3768a4ebfc7d111864f3d165977db37a6.tar.gz
vyatta-cfg-653569b3768a4ebfc7d111864f3d165977db37a6.zip
handle config locking
Diffstat (limited to 'src/commit.c')
-rw-r--r--src/commit.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/commit.c b/src/commit.c
index 7cd01df..9aafedd 100644
--- a/src/commit.c
+++ b/src/commit.c
@@ -117,7 +117,6 @@ static boolean validate_dir_for_commit()
if (strcmp(dirp->d_name, ".") == 0 ||
strcmp(dirp->d_name, "..") == 0 ||
strcmp(dirp->d_name, MOD_NAME) == 0 ||
- strcmp(dirp->d_name, LOCK_NAME) == 0 ||
strcmp(dirp->d_name, opaque_name) == 0 ||
strncmp(dirp->d_name, ".wh.", 4) == 0) {
continue; /*ignore dot and dot-dot*/
@@ -274,7 +273,7 @@ int main(int argc, char **argv)
bye("No configuration changes to commit\n");
}
- if(!get_config_lock(get_adirp(), LOCK_NAME)) {
+ if (get_config_lock() == -1) {
fprintf(out_stream, "Cannot commit: Configuration is locked\n");
bye("Configuration is locked\n");
}
@@ -387,7 +386,6 @@ boolean commit_update_child(vtw_def *pdefp, char *child,
if (strcmp(child, ".") == 0 ||
strcmp(child, "..") == 0 ||
strcmp(child, MOD_NAME) == 0 ||
- strcmp(child, LOCK_NAME) == 0 ||
strcmp(child, opaque_name) == 0)
return TRUE;
@@ -931,7 +929,6 @@ static boolean commit_delete_children(vtw_def *defp, boolean deleting,
if (strcmp(child, ".") == 0 ||
strcmp(child, "..") == 0 ||
strcmp(child, MOD_NAME) == 0 ||
- strcmp(child, LOCK_NAME) == 0 ||
strcmp(child, OPQ_NAME) == 0)
continue;
uename = clind_unescape(child);
@@ -1020,7 +1017,6 @@ static boolean commit_update_children(vtw_def *defp, boolean creating,
if (strcmp(child, ".") == 0 ||
strcmp(child, "..") == 0 ||
strcmp(child, MOD_NAME) == 0 ||
- strcmp(child, LOCK_NAME) == 0 ||
strcmp(child, OPQ_NAME) == 0)
continue;
cp = uename = clind_unescape(child);