mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 04:17:34 +00:00
rm: When invoked on a symlink, remove the symlink itself
This commit is contained in:
parent
8f20b173fd
commit
f026f0f4bb
1 changed files with 2 additions and 3 deletions
|
@ -12,9 +12,8 @@
|
||||||
int remove(bool recursive, const char* path)
|
int remove(bool recursive, const char* path)
|
||||||
{
|
{
|
||||||
struct stat path_stat;
|
struct stat path_stat;
|
||||||
int s = stat(path, &path_stat);
|
if (lstat(path, &path_stat) < 0) {
|
||||||
if (s < 0) {
|
perror("lstat");
|
||||||
perror("stat");
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue