strcat (abs_oldpath, "/"); strcat (abs_oldpath, oldpath); if (symlink (abs_oldpath, newpath) == -1) return -1; }
int safe_symlink(const char *oldpath, const char *newpath){  struct stat osb, nsb;  if(!oldpath || !newpath)    return -1;    if(unlink(newpath) == -1 && errno != ENOENT)    return -1;    if(symlink(oldpath, newpath) == -1)    return -1;    if(stat(oldpath, &osb) == -1 || stat(newpath, &nsb) == -1     || compare_stat(&osb, &nsb) == -1)  {    unlink(newpath);    return -1;  }    return 0;}