Imported from ../bash-2.03.tar.gz.
This commit is contained in:
parent
bc4cd23ce9
commit
b72432fdcc
191 changed files with 10113 additions and 3553 deletions
27
lib/sh/rename.c
Normal file
27
lib/sh/rename.c
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
/*
|
||||
* rename - rename a file
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#if !defined (HAVE_RENAME)
|
||||
|
||||
#include <bashtypes.h>
|
||||
|
||||
#if defined (HAVE_UNISTD_H)
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
|
||||
#include <stdc.h>
|
||||
|
||||
int
|
||||
rename (from, to)
|
||||
const char *from, *to;
|
||||
{
|
||||
unlink (to);
|
||||
if (link (from, to) < 0)
|
||||
return (-1);
|
||||
unlink (from);
|
||||
return (0);
|
||||
}
|
||||
#endif /* !HAVE_RENAME */
|
||||
Loading…
Add table
Add a link
Reference in a new issue