Blame support/xsymlink.c

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