Bug 109260 - sysutils/installwatch Bus Error
Summary: sysutils/installwatch Bus Error
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-ports-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-02-17 20:20 UTC by Jason DiCioccio
Modified: 2008-07-28 07:40 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jason DiCioccio 2007-02-17 20:20:02 UTC
	
When compiling installwatch from ports, the following warnings appear:
installwatch.c: In function `open':
installwatch.c:577: warning: `mode_t' is promoted to `int' when passed through `...'
installwatch.c:577: warning: (so you should pass `int' not `mode_t' to `va_arg')
installwatch.c:577: note: if this code is reached, the program will abort

The threat made by gcc on the last line is not an empty one.  When using
installwatch, it will exit with a bus error.

Fix: There's probably a better way to fix this, but as mode is defined as an int
in vfs_syscalls.c, I figured I'd just duplicate it here.  It quickly alleviated
the issue on my end.



!DSPAM:2756,45d75d51678051410918767!--XpEvIuylUheDYx8Si5N2YPLQ8i8vm7Zdwyh6hRqV9h5x8soN
Content-Type: text/plain; name="file.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="file.diff"

diff -urN installwatch.orig/files/patch-installwatch.c installwatch/files/patch-installwatch.c
--- installwatch.orig/files/patch-installwatch.c	Wed Dec 31 19:00:00 1969
+++ installwatch/files/patch-installwatch.c	Sat Feb 17 14:46:14 2007
@@ -0,0 +1,11 @@
+--- installwatch.c.orig	Sat Feb 17 14:45:22 2007
++++ installwatch.c	Sat Feb 17 14:45:47 2007
+@@ -574,7 +574,7 @@
+ 
+ 	REFCOUNT;
+ 	va_start(ap, flags);
+-	mode = va_arg(ap, mode_t);
++	mode = va_arg(ap, int);
+ 	va_end(ap);
+ 	canonicalize(pathname, canonic);
+ 
How-To-Repeat: 	
Install installwatch on FreeBSD 6.2, try to use it.
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2007-02-17 20:20:31 UTC
Responsible Changed
From-To: freebsd-ports-bugs->sergei

Over to maintainer
Comment 2 Mark Linimon freebsd_committer freebsd_triage 2008-07-27 07:01:22 UTC
Responsible Changed
From-To: sergei->freebsd-ports-bugs

Maintainer was reset.
Comment 3 Volker Stolz freebsd_committer freebsd_triage 2008-07-28 07:40:03 UTC
State Changed
From-To: open->closed

Committed, thanks! Might be worth sending to the original author. Sorry for the long delay. -Volker