hjl / source-git / glibc

Forked from source-git/glibc 3 years ago
Clone

Blame support/xsymlink.c

Packit b0207b
/* Error-checking replacement for "symlink".
Packit b0207b
   Copyright (C) 2018 Free Software Foundation, Inc.
Packit b0207b
   This file is part of the GNU C Library.
Packit b0207b
Packit b0207b
   The GNU C Library is free software; you can redistribute it and/or
Packit b0207b
   modify it under the terms of the GNU Lesser General Public
Packit b0207b
   License as published by the Free Software Foundation; either
Packit b0207b
   version 2.1 of the License, or (at your option) any later version.
Packit b0207b
Packit b0207b
   The GNU C Library is distributed in the hope that it will be useful,
Packit b0207b
   but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit b0207b
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit b0207b
   Lesser General Public License for more details.
Packit b0207b
Packit b0207b
   You should have received a copy of the GNU Lesser General Public
Packit b0207b
   License along with the GNU C Library; if not, see
Packit b0207b
   <http://www.gnu.org/licenses/>.  */
Packit b0207b
Packit b0207b
#include <support/support.h>
Packit b0207b
#include <support/check.h>
Packit b0207b
Packit b0207b
#include <unistd.h>
Packit b0207b
Packit b0207b
void
Packit b0207b
xsymlink (const char *target, const char *linkpath)
Packit b0207b
{
Packit b0207b
  if (symlink (target, linkpath) < 0)
Packit b0207b
    FAIL_EXIT1 ("symlink (\"%s\", \"%s\")", target, linkpath);
Packit b0207b
}