File:  [MW Coherent from dump] / coherent / g / usr / lib / uucp / tay104 / unix / link.c
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Wed May 29 04:56:35 2019 UTC (7 years ago) by root
Branches: MarkWilliams, MAIN
CVS tags: relic, HEAD
coherent

/* link.c
   Link two files.  */

#include "uucp.h"

#include "uudefs.h"
#include "sysdep.h"
#include "system.h"

#include <errno.h>

boolean
fsysdep_link (zfrom, zto, pfworked)
     const char *zfrom;
     const char *zto;
     boolean *pfworked;
{
  *pfworked = FALSE;
  if (link (zfrom, zto) == 0)
    {
      *pfworked = TRUE;
      return TRUE;
    }
  if (errno == ENOENT)
    {
      if (! fsysdep_make_dirs (zto, TRUE))
	return FALSE;
      if (link (zfrom, zto) == 0)
	{
	  *pfworked = TRUE;
	  return TRUE;
	}
    }
  if (errno == EXDEV)
    return TRUE;
  ulog (LOG_ERROR, "link (%s, %s): %s", zfrom, zto, strerror (errno));
  return FALSE;
}

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.