Back to index

cell-binutils  2.17cvs20070401
Defines | Functions
unlink-if-ordinary.c File Reference
#include <sys/types.h>
#include "libiberty.h"

Go to the source code of this file.


#define S_ISLNK(m)   0
#define lstat   stat


int unlink_if_ordinary (const char *name)

Define Documentation

#define lstat   stat

Definition at line 58 of file unlink-if-ordinary.c.

#define S_ISLNK (   m)    0

Definition at line 57 of file unlink-if-ordinary.c.

Function Documentation

int unlink_if_ordinary ( const char *  name)

Definition at line 63 of file unlink-if-ordinary.c.

  struct stat st;

  if (lstat (name, &st) == 0
      && (S_ISREG (st.st_mode) || S_ISLNK (st.st_mode)))
    return unlink (name);

  return 1;

Here is the caller graph for this function: