From owner-svn-src-head@FreeBSD.ORG Mon Feb 23 07:33:29 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7A48D106564A; Mon, 23 Feb 2009 07:33:29 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5EBEA8FC08; Mon, 23 Feb 2009 07:33:29 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1N7XTJf017957; Mon, 23 Feb 2009 07:33:29 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1N7XTUB017956; Mon, 23 Feb 2009 07:33:29 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <200902230733.n1N7XTUB017956@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Mon, 23 Feb 2009 07:33:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188934 - head/tools/regression/fstest X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Feb 2009 07:33:30 -0000 Author: pjd Date: Mon Feb 23 07:33:29 2009 New Revision: 188934 URL: http://svn.freebsd.org/changeset/base/188934 Log: Add explicit casting in few places. It is only really necessary for open(2)'s third argument, which is optional and obtained through stdarg(3). open(2)'s third argument is 32bit and we pass 64 bits. On little endian it works, because we take lower 32 bits, but on big endian platforms we take upper 32 bits, so we end up with 0. Reported by: Milan Čermák Modified: head/tools/regression/fstest/fstest.c Modified: head/tools/regression/fstest/fstest.c ============================================================================== --- head/tools/regression/fstest/fstest.c Mon Feb 23 06:47:10 2009 (r188933) +++ head/tools/regression/fstest/fstest.c Mon Feb 23 07:33:29 2009 (r188934) @@ -337,7 +337,7 @@ show_stat(struct stat64 *sp, const char printf("%lld", (long long)sp->st_ctime); #ifdef HAS_CHFLAGS else if (strcmp(what, "flags") == 0) - printf("%s", flags2str(chflags_flags, sp->st_flags)); + printf("%s", flags2str(chflags_flags, (long long)sp->st_flags)); #endif else if (strcmp(what, "type") == 0) { switch (sp->st_mode & S_IFMT) { @@ -443,17 +443,17 @@ call_syscall(struct syscall_desc *scall, fprintf(stderr, "too few arguments\n"); exit(1); } - rval = open(STR(0), flags, (mode_t)NUM(2)); + rval = open(STR(0), (int)flags, (mode_t)NUM(2)); } else { if (i == 3) { fprintf(stderr, "too many arguments\n"); exit(1); } - rval = open(STR(0), flags); + rval = open(STR(0), (int)flags); } break; case ACTION_CREATE: - rval = open(STR(0), O_CREAT | O_EXCL, NUM(1)); + rval = open(STR(0), O_CREAT | O_EXCL, (mode_t)NUM(1)); if (rval >= 0) close(rval); break; @@ -461,7 +461,7 @@ call_syscall(struct syscall_desc *scall, rval = unlink(STR(0)); break; case ACTION_MKDIR: - rval = mkdir(STR(0), NUM(1)); + rval = mkdir(STR(0), (mode_t)NUM(1)); break; case ACTION_RMDIR: rval = rmdir(STR(0)); @@ -476,30 +476,30 @@ call_syscall(struct syscall_desc *scall, rval = rename(STR(0), STR(1)); break; case ACTION_MKFIFO: - rval = mkfifo(STR(0), NUM(1)); + rval = mkfifo(STR(0), (mode_t)NUM(1)); break; case ACTION_CHMOD: - rval = chmod(STR(0), NUM(1)); + rval = chmod(STR(0), (mode_t)NUM(1)); break; #ifdef HAS_LCHMOD case ACTION_LCHMOD: - rval = lchmod(STR(0), NUM(1)); + rval = lchmod(STR(0), (mode_t)NUM(1)); break; #endif case ACTION_CHOWN: - rval = chown(STR(0), NUM(1), NUM(2)); + rval = chown(STR(0), (uid_t)NUM(1), (gid_t)NUM(2)); break; case ACTION_LCHOWN: - rval = lchown(STR(0), NUM(1), NUM(2)); + rval = lchown(STR(0), (uid_t)NUM(1), (gid_t)NUM(2)); break; #ifdef HAS_CHFLAGS case ACTION_CHFLAGS: - rval = chflags(STR(0), str2flags(chflags_flags, STR(1))); + rval = chflags(STR(0), (unsigned long)str2flags(chflags_flags, STR(1))); break; #endif #ifdef HAS_LCHFLAGS case ACTION_LCHFLAGS: - rval = lchflags(STR(0), str2flags(chflags_flags, STR(1))); + rval = lchflags(STR(0), (unsigned long)str2flags(chflags_flags, STR(1))); break; #endif case ACTION_TRUNCATE: