Blame support/xsymlink.c

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