New upstream version 1.8
[debian/gzip] / lib / fchdir.c
index 36a8e358b7a1322316c56e132c6b30f65e08a367..8a7a072d7a625b4923b565e549bca3fa33205ce7 100644 (file)
@@ -1,5 +1,5 @@
 /* fchdir replacement.
-   Copyright (C) 2006-2013 Free Software Foundation, Inc.
+   Copyright (C) 2006-2016 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
@@ -19,7 +19,6 @@
 /* Specification.  */
 #include <unistd.h>
 
-#include <assert.h>
 #include <dirent.h>
 #include <errno.h>
 #include <fcntl.h>
@@ -29,6 +28,7 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 
+#include "assure.h"
 #include "dosname.h"
 #include "filenamecat.h"
 
@@ -132,7 +132,7 @@ _gl_register_fd (int fd, const char *filename)
 {
   struct stat statbuf;
 
-  assert (0 <= fd);
+  assure (0 <= fd);
   if (REPLACE_OPEN_DIRECTORY
       || (fstat (fd, &statbuf) == 0 && S_ISDIR (statbuf.st_mode)))
     {
@@ -156,7 +156,7 @@ _gl_register_fd (int fd, const char *filename)
 int
 _gl_register_dup (int oldfd, int newfd)
 {
-  assert (0 <= oldfd && 0 <= newfd && oldfd != newfd);
+  assure (0 <= oldfd && 0 <= newfd && oldfd != newfd);
   if (oldfd < dirs_allocated && dirs[oldfd].name)
     {
       /* Duplicated a directory; must ensure newfd is allocated.  */