svn commit: r341711 - head/sys/kern

Konstantin Belousov kib at FreeBSD.org
Fri Dec 7 23:05:14 UTC 2018


Author: kib
Date: Fri Dec  7 23:05:12 2018
New Revision: 341711
URL: https://svnweb.freebsd.org/changeset/base/341711

Log:
  Fix expression evaluation.
  
  Braces were put in the wrong place, causing failing EAGAIN check to
  return zero result.  Remove the problematic assignment from the
  conditional expression at all.
  
  While there, remove used once variable vp, and wrap too long line.
  
  Sponsored by:	The FreeBSD Foundation
  MFC after:	1 week

Modified:
  head/sys/kern/vfs_syscalls.c

Modified: head/sys/kern/vfs_syscalls.c
==============================================================================
--- head/sys/kern/vfs_syscalls.c	Fri Dec  7 21:58:08 2018	(r341710)
+++ head/sys/kern/vfs_syscalls.c	Fri Dec  7 23:05:12 2018	(r341711)
@@ -1502,19 +1502,18 @@ int
 kern_linkat(struct thread *td, int fd1, int fd2, const char *path1,
     const char *path2, enum uio_seg segflag, int follow)
 {
-	struct vnode *vp;
 	struct nameidata nd;
 	int error;
 
 	do {
 		bwillwrite();
-		NDINIT_ATRIGHTS(&nd, LOOKUP, follow | AUDITVNODE1, segflag, path1, fd1,
-		    &cap_linkat_source_rights, td);
+		NDINIT_ATRIGHTS(&nd, LOOKUP, follow | AUDITVNODE1, segflag,
+		    path1, fd1, &cap_linkat_source_rights, td);
 		if ((error = namei(&nd)) != 0)
 			return (error);
 		NDFREE(&nd, NDF_ONLY_PNBUF);
-		vp = nd.ni_vp;
-	} while ((error = kern_linkat_vp(td, vp, fd2, path2, segflag) == EAGAIN));
+		error = kern_linkat_vp(td, nd.ni_vp, fd2, path2, segflag);
+	} while (error ==  EAGAIN);
 	return (error);
 }
 


More information about the svn-src-all mailing list