summaryrefslogtreecommitdiff
path: root/lib/savewd.c
diff options
context:
space:
mode:
authorIgor Pashev <pashev.igor@gmail.com>2015-07-04 17:13:50 +0300
committerIgor Pashev <pashev.igor@gmail.com>2015-07-04 17:13:50 +0300
commit71cd8e3a743046573744123777061b64881bf372 (patch)
tree82522befe647f4fff186a5630cad0cad33f8ef53 /lib/savewd.c
parentc18578632fd3c9e513e613a86ba2b7c4ebee6c45 (diff)
downloadcoreutils-upstream.tar.gz
Imported Upstream version 8.24upstream/8.24upstream
Diffstat (limited to 'lib/savewd.c')
-rw-r--r--lib/savewd.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/lib/savewd.c b/lib/savewd.c
index 88c5feff..16f56a8e 100644
--- a/lib/savewd.c
+++ b/lib/savewd.c
@@ -1,6 +1,6 @@
/* Save and restore the working directory, possibly using a child process.
- Copyright (C) 2006-2007, 2009-2014 Free Software Foundation, Inc.
+ Copyright (C) 2006-2007, 2009-2015 Free Software Foundation, Inc.
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
@@ -23,7 +23,6 @@
#include "savewd.h"
-#include <assert.h>
#include <errno.h>
#include <fcntl.h>
#include <signal.h>
@@ -33,6 +32,7 @@
#include <sys/wait.h>
#include <unistd.h>
+#include "assure.h"
#include "dosname.h"
#include "fcntl-safer.h"
@@ -88,7 +88,7 @@ savewd_save (struct savewd *wd)
break;
default:
- assert (false);
+ assure (false);
}
return false;
@@ -144,11 +144,11 @@ savewd_chdir (struct savewd *wd, char const *dir, int options,
break;
case FORKING_STATE:
- assert (wd->val.child == 0);
+ assure (wd->val.child == 0);
break;
default:
- assert (false);
+ assure (false);
}
}
}
@@ -205,7 +205,7 @@ savewd_restore (struct savewd *wd, int status)
{
int child_status;
while (waitpid (child, &child_status, 0) < 0)
- assert (errno == EINTR);
+ assure (errno == EINTR);
wd->val.child = -1;
if (! WIFEXITED (child_status))
raise (WTERMSIG (child_status));
@@ -215,7 +215,7 @@ savewd_restore (struct savewd *wd, int status)
break;
default:
- assert (false);
+ assure (false);
}
return 0;
@@ -236,11 +236,11 @@ savewd_finish (struct savewd *wd)
break;
case FORKING_STATE:
- assert (wd->val.child < 0);
+ assure (wd->val.child < 0);
break;
default:
- assert (false);
+ assure (false);
}
wd->state = FINAL_STATE;