delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2000/08/23/16:52:23

Message-ID: <39A43A66.5B38FCE5@softhome.net>
Date: Wed, 23 Aug 2000 22:56:06 +0200
From: Laurynas Biveinis <lauras AT softhome DOT net>
X-Mailer: Mozilla 4.74 [en] (Win98; U)
X-Accept-Language: lt,en
MIME-Version: 1.0
To: DJGPP Workers <djgpp-workers AT delorie DOT com>
Subject: Patch: symlinks in rmdir()
Reply-To: djgpp-workers AT delorie DOT com

As a nice custom, relinked 'rmdir' now
does wonders with symlinks :)

Any comments?

Laurynas

Index: rmdir.c
===================================================================
RCS file: /cvs/djgpp/djgpp/src/libc/posix/unistd/rmdir.c,v
retrieving revision 1.3
diff -u -p -r1.3 rmdir.c
--- rmdir.c	1998/06/29 00:15:44	1.3
+++ rmdir.c	2000/08/23 20:50:07
@@ -1,26 +1,33 @@
+/* Copyright (C) 2000 DJ Delorie, see COPYING.DJ for details */
 /* Copyright (C) 1998 DJ Delorie, see COPYING.DJ for details */
 /* Copyright (C) 1996 DJ Delorie, see COPYING.DJ for details */
 /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
 #include <libc/stubs.h>
+#include <libc/symlink.h>
 #include <errno.h>
 #include <unistd.h>
 #include <fcntl.h>
 #include <go32.h>
 #include <dpmi.h>
+#include <stdio.h>
 #include <libc/dosio.h>
 
 int
 rmdir(const char *mydirname)
 {
   __dpmi_regs r;
+  char real_dir[FILENAME_MAX];
 
+  if (!__solve_dir_symlinks(mydirname, real_dir))
+    return -1;
+
   if(_USE_LFN)
     r.x.ax = 0x713a;
   else
     r.h.ah = 0x3a;
   r.x.ds = __tb_segment;
   r.x.dx = __tb_offset;
-  _put_path(mydirname);
+  _put_path(real_dir);
   __dpmi_int(0x21, &r);
 
   if (r.x.flags & 1)

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019