/*
- * $Id: afp_options.c,v 1.28 2002-12-07 02:39:57 rlewczuk Exp $
+ * $Id: afp_options.c,v 1.29 2003-01-12 14:39:57 didg Exp $
*
* Copyright (c) 1997 Adrian Sun (asun@zoology.washington.edu)
* Copyright (c) 1990,1993 Regents of The University of Michigan.
perror( "gethostname" );
return 0;
}
- if (( p = strchr(options->hostname, '.' )) != 0 ) {
+ if (NULL != ( p = strchr(options->hostname, '.' )) ) {
*p = '\0';
}
- if (( p = strrchr( av[ 0 ], '/' )) == NULL ) {
+ if (NULL == ( p = strrchr( av[ 0 ], '/' )) ) {
p = av[ 0 ];
} else {
p++;
}
- while (( c = getopt( ac, av, OPTIONS )) != EOF ) {
+ while (EOF != ( c = getopt( ac, av, OPTIONS )) ) {
switch ( c ) {
case 'd' :
options->flags |= OPTION_DEBUG;
/*
- * $Id: appl.c,v 1.9 2003-01-08 15:01:33 didg Exp $
+ * $Id: appl.c,v 1.10 2003-01-12 14:39:58 didg Exp $
*
* Copyright (c) 1990,1993 Regents of The University of Michigan.
* All Rights Reserved. See COPYRIGHT.
memcpy( &vid, ibuf, sizeof( vid ));
ibuf += sizeof( vid );
- if (( vol = getvolbyvid( vid )) == NULL ) {
+ if (NULL == ( vol = getvolbyvid( vid ))) {
return( AFPERR_PARAM );
}
memcpy( &vid, ibuf, sizeof( vid ));
ibuf += sizeof( vid );
- if (( vol = getvolbyvid( vid )) == NULL ) {
+ if (NULL == ( vol = getvolbyvid( vid ))) {
return( AFPERR_PARAM );
}
memcpy( &vid, ibuf, sizeof( vid ));
ibuf += sizeof( vid );
- if (( vol = getvolbyvid( vid )) == NULL ) {
+ if (NULL == ( vol = getvolbyvid( vid )) ) {
*rbuflen = 0;
return( AFPERR_PARAM );
}
/*
- * $Id: desktop.c,v 1.20 2003-01-08 15:01:33 didg Exp $
+ * $Id: desktop.c,v 1.21 2003-01-12 14:39:58 didg Exp $
*
* See COPYRIGHT.
*
ibuf += 2;
memcpy( &vid, ibuf, sizeof(vid));
- if (( vol = getvolbyvid( vid )) == NULL ) {
+ if (NULL == ( vol = getvolbyvid( vid )) ) {
*rbuflen = 0;
return( AFPERR_PARAM );
}
memcpy( &vid, ibuf, sizeof( vid ));
ibuf += sizeof( vid );
- if (( vol = getvolbyvid( vid )) == NULL ) {
+ if (NULL == ( vol = getvolbyvid( vid )) ) {
return( AFPERR_PARAM );
}
memcpy( &did, ibuf, sizeof( did ));
ibuf += sizeof( did );
- if (( dir = dirlookup( vol, did )) == NULL ) {
+ if (NULL == ( dir = dirlookup( vol, did )) ) {
return afp_errno;
}
- if (( path = cname( vol, dir, &ibuf )) == NULL ) {
+ if (NULL == ( path = cname( vol, dir, &ibuf )) ) {
return afp_errno;
}
memcpy( &vid, ibuf, sizeof( vid ));
ibuf += sizeof( vid );
- if (( vol = getvolbyvid( vid )) == NULL ) {
+ if (NULL == ( vol = getvolbyvid( vid )) ) {
return( AFPERR_PARAM );
}
memcpy( &did, ibuf, sizeof( did ));
ibuf += sizeof( did );
- if (( dir = dirlookup( vol, did )) == NULL ) {
+ if (NULL == ( dir = dirlookup( vol, did )) ) {
return afp_errno;
}
- if (( s_path = cname( vol, dir, &ibuf )) == NULL ) {
+ if (NULL == ( s_path = cname( vol, dir, &ibuf )) ) {
return afp_errno;
}
memcpy( &vid, ibuf, sizeof( vid ));
ibuf += sizeof( vid );
- if (( vol = getvolbyvid( vid )) == NULL ) {
+ if (NULL == ( vol = getvolbyvid( vid )) ) {
return( AFPERR_PARAM );
}
memcpy( &did, ibuf, sizeof( did ));
ibuf += sizeof( did );
- if (( dir = dirlookup( vol, did )) == NULL ) {
+ if (NULL == ( dir = dirlookup( vol, did )) ) {
return afp_errno;
}
- if (( s_path = cname( vol, dir, &ibuf )) == NULL ) {
+ if (NULL == ( s_path = cname( vol, dir, &ibuf ))) {
return afp_errno;
}
/*
- * $Id: directory.c,v 1.55 2003-01-08 15:01:33 didg Exp $
+ * $Id: directory.c,v 1.56 2003-01-12 14:39:58 didg Exp $
*
* Copyright (c) 1990,1993 Regents of The University of Michigan.
* All Rights Reserved. See COPYRIGHT.
return ret;
id = did;
- if ((upath = cnid_resolve(vol->v_db, &id, buffer, buflen)) == NULL) {
+ if (NULL == (upath = cnid_resolve(vol->v_db, &id, buffer, buflen)) ) {
afp_errno = AFPERR_NOOBJ;
return NULL;
}
memcpy( &vid, ibuf, sizeof( vid ));
ibuf += sizeof( vid );
- if (( vol = getvolbyvid( vid )) == NULL ) {
+ if (NULL == ( vol = getvolbyvid( vid )) ) {
return( AFPERR_PARAM );
}
memcpy( &vid, ibuf, sizeof( vid ));
ibuf += sizeof( vid );
- if (( vol = getvolbyvid( vid )) == NULL ) {
+ if (NULL == ( vol = getvolbyvid( vid )) ) {
return( AFPERR_PARAM );
}
memcpy( &did, ibuf, sizeof( did ));
ibuf += sizeof( did );
- if (( dir = dirlookup( vol, did )) == NULL ) {
+ if (NULL == ( dir = dirlookup( vol, did )) ) {
return( AFPERR_NOOBJ );
}
- if (( s_path = cname( vol, dir, &ibuf )) == NULL ) {
+ if (NULL == ( s_path = cname( vol, dir, &ibuf )) ) {
return afp_errno;
}
/* FIXME check done elswhere? cname was able to move curdir to it! */
memcpy(&vid, ibuf, sizeof(vid));
ibuf += sizeof( vid );
- if (( vol = getvolbyvid( vid )) == NULL ) {
+ if (NULL == ( vol = getvolbyvid( vid )) ) {
return( AFPERR_PARAM );
}
memcpy(&did, ibuf, sizeof(did));
ibuf += sizeof(did);
- if (( parentdir = dirlookup( vol, did )) == NULL ) {
+ if (NULL == ( parentdir = dirlookup( vol, did )) ) {
return afp_errno;
}
- if (( path = cname( vol, parentdir, &ibuf )) == NULL ) {
+ if (NULL == ( path = cname( vol, parentdir, &ibuf )) ) {
return afp_errno;
}
/*
- * $Id: enumerate.c,v 1.29 2003-01-07 22:13:39 didg Exp $
+ * $Id: enumerate.c,v 1.30 2003-01-12 14:39:59 didg Exp $
*
* Copyright (c) 1990,1993 Regents of The University of Michigan.
* All Rights Reserved. See COPYRIGHT.
memcpy( &vid, ibuf, sizeof( vid ));
ibuf += sizeof( vid );
- if (( vol = getvolbyvid( vid )) == NULL ) {
+ if (NULL == ( vol = getvolbyvid( vid )) ) {
*rbuflen = 0;
return( AFPERR_PARAM );
}
memcpy( &did, ibuf, sizeof( did ));
ibuf += sizeof( did );
- if (( dir = dirlookup( vol, did )) == NULL ) {
+ if (NULL == ( dir = dirlookup( vol, did )) ) {
*rbuflen = 0;
return( AFPERR_NODIR );
}
maxsz = min(maxsz, *rbuflen);
- if (( o_path = cname( vol, dir, &ibuf )) == NULL) {
+ if (NULL == ( o_path = cname( vol, dir, &ibuf )) ) {
*rbuflen = 0;
return( AFPERR_NODIR );
}
/*
- * $Id: file.c,v 1.71 2003-01-11 17:26:06 jmarcus Exp $
+ * $Id: file.c,v 1.72 2003-01-12 14:39:59 didg Exp $
*
* Copyright (c) 1990,1993 Regents of The University of Michigan.
* All Rights Reserved. See COPYRIGHT.
memcpy(&vid, ibuf, sizeof( vid ));
ibuf += sizeof( vid );
- if (( vol = getvolbyvid( vid )) == NULL ) {
+ if (NULL == ( vol = getvolbyvid( vid )) ) {
return( AFPERR_PARAM );
}
memcpy(&did, ibuf, sizeof( did));
ibuf += sizeof( did );
- if (( dir = dirlookup( vol, did )) == NULL ) {
+ if (NULL == ( dir = dirlookup( vol, did )) ) {
return afp_errno;
}
- if (( s_path = cname( vol, dir, &ibuf )) == NULL ) {
+ if (NULL == ( s_path = cname( vol, dir, &ibuf )) ) {
return afp_errno;
}
memcpy(&vid, ibuf, sizeof( vid ));
ibuf += sizeof( vid );
- if (( vol = getvolbyvid( vid )) == NULL ) {
+ if (NULL == ( vol = getvolbyvid( vid )) ) {
return( AFPERR_PARAM );
}
memcpy(&svid, ibuf, sizeof( svid ));
ibuf += sizeof( svid );
- if (( vol = getvolbyvid( svid )) == NULL ) {
+ if (NULL == ( vol = getvolbyvid( svid )) ) {
return( AFPERR_PARAM );
}
memcpy(&sdid, ibuf, sizeof( sdid ));
ibuf += sizeof( sdid );
- if (( dir = dirlookup( vol, sdid )) == NULL ) {
+ if (NULL == ( dir = dirlookup( vol, sdid )) ) {
return afp_errno;
}
memcpy(&vid, ibuf, sizeof(vid));
ibuf += sizeof(vid);
- if (( vol = getvolbyvid( vid )) == NULL ) {
+ if (NULL == ( vol = getvolbyvid( vid )) ) {
return( AFPERR_PARAM);
}
memcpy(&vid, ibuf, sizeof(vid));
ibuf += sizeof(vid);
- if (( vol = getvolbyvid( vid )) == NULL ) {
+ if (NULL == ( vol = getvolbyvid( vid )) ) {
return( AFPERR_PARAM);
}
/*
- * $Id: filedir.c,v 1.37 2003-01-08 15:01:34 didg Exp $
+ * $Id: filedir.c,v 1.38 2003-01-12 14:40:01 didg Exp $
*
* Copyright (c) 1990,1993 Regents of The University of Michigan.
* All Rights Reserved. See COPYRIGHT.
memcpy( &vid, ibuf, sizeof( vid ));
ibuf += sizeof( vid );
- if (( vol = getvolbyvid( vid )) == NULL ) {
+ if (NULL == ( vol = getvolbyvid( vid )) ) {
return( AFPERR_PARAM );
}
memcpy( &did, ibuf, sizeof( did ));
ibuf += sizeof( did );
- if (( dir = dirlookup( vol, did )) == NULL ) {
+ if (NULL == ( dir = dirlookup( vol, did )) ) {
return afp_errno;
}
dbitmap = ntohs( dbitmap );
ibuf += sizeof( dbitmap );
- if (( s_path = cname( vol, dir, &ibuf )) == NULL) {
+ if (NULL == ( s_path = cname( vol, dir, &ibuf )) ) {
return afp_errno;
}
memcpy( &vid, ibuf, sizeof(vid));
ibuf += sizeof( vid );
- if (( vol = getvolbyvid( vid )) == NULL ) {
+ if (NULL == ( vol = getvolbyvid( vid )) ) {
return( AFPERR_PARAM );
}
memcpy( &vid, ibuf, sizeof( vid ));
ibuf += sizeof( vid );
- if (( vol = getvolbyvid( vid )) == NULL ) {
+ if (NULL == ( vol = getvolbyvid( vid )) ) {
return( AFPERR_PARAM );
}
memcpy( &did, ibuf, sizeof( did ));
ibuf += sizeof( did );
- if (( sdir = dirlookup( vol, did )) == NULL ) {
+ if (NULL == ( sdir = dirlookup( vol, did )) ) {
return afp_errno;
}
memcpy( &vid, ibuf, sizeof( vid ));
ibuf += sizeof( vid );
- if (( vol = getvolbyvid( vid )) == NULL ) {
+ if (NULL == ( vol = getvolbyvid( vid )) ) {
return( AFPERR_PARAM );
}
memcpy( &did, ibuf, sizeof( did ));
ibuf += sizeof( int );
- if (( dir = dirlookup( vol, did )) == NULL ) {
+ if (NULL == ( dir = dirlookup( vol, did )) ) {
return afp_errno;
}
rc = deletecurdir( vol, obj->oldtmp, AFPOBJ_TMPSIZ);
} else if (of_findname(s_path)) {
rc = AFPERR_BUSY;
- } else if ((rc = deletefile( upath, 1)) == AFP_OK) {
+ } else if (AFP_OK == (rc = deletefile( upath, 1))) {
#ifdef CNID_DB /* get rid of entry */
cnid_t id = cnid_get(vol->v_db, curdir->d_did, upath, strlen(upath));
cnid_delete(vol->v_db, id);
memcpy( &vid, ibuf, sizeof( vid ));
ibuf += sizeof( vid );
- if (( vol = getvolbyvid( vid )) == NULL ) {
+ if (NULL == ( vol = getvolbyvid( vid )) ) {
return( AFPERR_PARAM );
}
/* source did followed by dest did */
memcpy( &did, ibuf, sizeof( did ));
ibuf += sizeof( int );
- if (( sdir = dirlookup( vol, did )) == NULL ) {
+ if (NULL == ( sdir = dirlookup( vol, did )) ) {
return( AFPERR_PARAM );
}
/*
- * $Id: fork.c,v 1.42 2003-01-10 05:29:01 didg Exp $
+ * $Id: fork.c,v 1.43 2003-01-12 14:40:01 didg Exp $
*
* Copyright (c) 1990,1993 Regents of The University of Michigan.
* All Rights Reserved. See COPYRIGHT.
memcpy(&ofrefnum, ibuf, sizeof( ofrefnum ));
ibuf += sizeof( u_short );
- if (( ofork = of_find( ofrefnum )) == NULL ) {
+ if (NULL == ( ofork = of_find( ofrefnum )) ) {
LOG(log_error, logtype_afpd, "afp_read: of_find");
err = AFPERR_PARAM;
goto afp_read_err;
ibuf += 2;
memcpy(&vid, ibuf, sizeof(vid));
- if (( vol = getvolbyvid( vid )) == NULL ) {
+ if (NULL == ( vol = getvolbyvid( vid )) ) {
return( AFPERR_PARAM );
}
}
}
- if (( ret = getforkparams( ofork, bitmap,
- rbuf + sizeof( u_short ), &buflen, attrbits )) != AFP_OK ) {
+ if (AFP_OK != ( ret = getforkparams( ofork, bitmap,
+ rbuf + sizeof( u_short ), &buflen, attrbits ))) {
return( ret );
}
/*
- * $Id: mangle.c,v 1.13 2002-12-18 00:17:03 jmarcus Exp $
+ * $Id: mangle.c,v 1.14 2003-01-12 14:40:02 didg Exp $
*
* Copyright (c) 2002. Joe Marcus Clarke (marcus@marcuscom.com)
* All Rights Reserved. See COPYRIGHT.
return mfilename;
}
- if ((ext = strrchr(mfilename, '.')) != NULL) {
+ if (NULL != (ext = strrchr(mfilename, '.')) ) {
ext_len = strlen(ext);
}
if (strlen(mangle) != strlen(MANGLE_CHAR) + MANGLE_LENGTH + ext_len) {
}
/* First, attmept to locate a file extension. */
- if ((ext = strrchr(filename, '.')) != NULL) {
+ if (NULL != (ext = strrchr(filename, '.')) ) {
ext_len = strlen(ext);
if (ext_len > MAX_EXT_LENGTH) {
/* Do some bounds checking to prevent an extension overflow. */
/*
- * $Id: unix.c,v 1.41 2003-01-08 15:01:36 didg Exp $
+ * $Id: unix.c,v 1.42 2003-01-12 14:40:03 didg Exp $
*
* Copyright (c) 1990,1993 Regents of The University of Michigan.
* All Rights Reserved. See COPYRIGHT.
LOG(log_error, logtype_afpd, "cannot opendir() [%s] (uid = %d): %s\n", path, uid, strerror(errno));
goto recursive_chown_end;
}
- while ((entry=readdir(odir)) != NULL) {
+ while (NULL != (entry=readdir(odir)) ) {
name = entry->d_name;
if (name[0] == '.' && name[1] == '\0')
continue;
/*
- * $Id: volume.c,v 1.45 2003-01-08 15:01:37 didg Exp $
+ * $Id: volume.c,v 1.46 2003-01-12 14:40:04 didg Exp $
*
* Copyright (c) 1990,1993 Regents of The University of Michigan.
* All Rights Reserved. See COPYRIGHT.
int c;
p = buf;
- while ((( c = getc( fp )) != EOF ) && ( size > 0 )) {
+ while ((EOF != ( c = getc( fp )) ) && ( size > 0 )) {
if ( c == '\n' || c == '\r' ) {
*p++ = '\n';
break;
strcat( path, p2 );
}
- if (( fp = fopen( path, "r" )) == NULL ) {
+ if (NULL == ( fp = fopen( path, "r" )) ) {
return( -1 );
}
*rbuflen = 0;
ibuf += 2;
memcpy(&vid, ibuf, sizeof( vid ));
- if (( vol = getvolbyvid( vid )) == NULL ) {
+ if (NULL == ( vol = getvolbyvid( vid )) ) {
return( AFPERR_PARAM );
}
char *p;
struct extmap *em;
- if (( p = strrchr( path, '.' )) == NULL ) {
+ if (NULL == ( p = strrchr( path, '.' )) ) {
return( defextmap );
}
p++;
memcpy(&bitmap, ibuf, sizeof( bitmap ));
bitmap = ntohs( bitmap );
- if (( vol = getvolbyvid( vid )) == NULL ) {
+ if (NULL == ( vol = getvolbyvid( vid )) ) {
*rbuflen = 0;
return( AFPERR_PARAM );
}
/*
- * $Id: ad_open.c,v 1.24 2002-11-26 18:48:23 didg Exp $
+ * $Id: ad_open.c,v 1.25 2003-01-12 14:40:04 didg Exp $
*
* Copyright (c) 1999 Adrian Sun (asun@u.washington.edu)
* Copyright (c) 1990,1991 Regents of The University of Michigan.
}
slash = ".Parent";
} else {
- if (( slash = strrchr( buf, '/' )) != NULL ) {
+ if (NULL != ( slash = strrchr( buf, '/' )) ) {
c = *++slash;
*slash = '\0';
strncpy( pathbuf, buf, MAXPATHLEN);
* For a path which is just a filename, use "." instead.
*/
strcpy( modebuf, path );
- if (( slash = strrchr( modebuf, '/' )) != NULL ) {
+ if (NULL != ( slash = strrchr( modebuf, '/' )) ) {
*slash = '\0'; /* remove pathname component */
} else {
modebuf[0] = '.'; /* use current directory */
* mkdir it.
*/
if (errno == ENOENT && (adflags & ADFLAGS_NOADOUBLE) == 0) {
- if (( slash = strrchr( ad_p, '/' )) == NULL ) {
+ if (NULL == ( slash = strrchr( ad_p, '/' )) ) {
ad_close( ad, adflags );
return( -1 );
}
/*
- * $Id: dsi_stream.c,v 1.9 2002-10-11 14:18:39 didg Exp $
+ * $Id: dsi_stream.c,v 1.10 2003-01-12 14:40:05 didg Exp $
*
* Copyright (c) 1998 Adrian Sun (asun@zoology.washington.edu)
* All rights reserved. See COPYRIGHT.
written = 0;
while (written < length) {
- if (((len = write(dsi->socket, (u_int8_t *) data + written,
- length - written)) == -1 && errno == EINTR) ||
+ if ((-1 == (len = write(dsi->socket, (u_int8_t *) data + written,
+ length - written)) && errno == EINTR) ||
!len)
continue;