Some very small fixes
[tinc] / lib / dropin.c
index 5f4fceb..9de5c2c 100644 (file)
@@ -1,7 +1,7 @@
 /*
     dropin.c -- a set of drop-in replacements for libc functions
-    Copyright (C) 2000 Ivo Timmermans <itimmermans@bigfoot.com>,
-                  2000 Guus Sliepen <guus@sliepen.warande.net>
+    Copyright (C) 2000,2001 Ivo Timmermans <itimmermans@bigfoot.com>,
+                  2000,2001 Guus Sliepen <guus@sliepen.warande.net>
 
     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
@@ -17,7 +17,7 @@
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
-    $Id: dropin.c,v 1.1.2.2 2000/11/29 00:33:15 zarq Exp $
+    $Id: dropin.c,v 1.1.2.4 2001/02/06 10:12:51 guus Exp $
 */
 
 #include "config.h"
@@ -31,6 +31,7 @@
 #include <xalloc.h>
 
 #include <system.h>
+#include <errno.h>
 
 #ifndef HAVE_DAEMON
 /*
@@ -113,6 +114,7 @@ char *get_current_dir_name(void)
 {
   size_t size;
   char *buf;
+  char *r;
 
   /* Start with 100 bytes.  If this turns out to be insufficient to
      contain the working directory, double the size.  */
@@ -123,7 +125,7 @@ char *get_current_dir_name(void)
   r = getcwd(buf, size);
   /* getcwd returns NULL and sets errno to ERANGE if the bufferspace
      is insufficient to contain the entire working directory.  */
-  while(r == NULL && errno = ERANGE)
+  while(r == NULL && errno == ERANGE)
     {
       free(buf);
       size <<= 1; /* double the size */