X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=blobdiff_plain;f=src%2Funix.c;h=268deba112ffa29277d5eb4e9c878e1d044f3f81;hp=73bd7c56f21303ae9924654daec85d679238dea6;hb=8377081b9917f820ae91f17e24743c84ef0cfc4d;hpb=377e50914cd78d52e77032a3eaf8972f23b4e7b9 diff --git a/src/unix.c b/src/unix.c index 73bd7c5..268deba 100644 --- a/src/unix.c +++ b/src/unix.c @@ -1,9 +1,6 @@ -/* - * Copyright (C) 1995-2007, Index Data ApS +/* This file is part of the YAZ toolkit. + * Copyright (C) 1995-2008 Index Data * See the file LICENSE for details. - * - * $Id: unix.c,v 1.20 2007-10-09 06:00:56 adam Exp $ - * UNIX socket COMSTACK. By Morten Bøgeskov. */ /** * \file unix.c @@ -428,8 +425,16 @@ static int unix_bind(COMSTACK h, void *address, int mode) h->cerrno = CSYSERR; return -1; } - chown(path, sp->uid, sp->gid); - chmod(path, sp->umask != -1 ? sp->umask : 0666); + if (chown(path, sp->uid, sp->gid)) + { + h->cerrno = CSYSERR; + return -1; + } + if (chmod(path, sp->umask != -1 ? sp->umask : 0666)) + { + h->cerrno = CSYSERR; + return -1; + } if (mode == CS_SERVER && listen(h->iofile, 100) < 0) { h->cerrno = CSYSERR;