Bug 626

Summary: alarm return value rounds up rather than to nearest
Product: glibc Reporter: Roland McGrath <roland>
Component: libcAssignee: Roland McGrath <roland>
Status: RESOLVED FIXED    
Severity: normal CC: glibc-bugs, jakub
Priority: P2 Flags: fweimer: security-
Version: 2.3.4   
Target Milestone: ---   
Host: Target:
Build: Last reconfirmed:
Project(s) to access: ssh public key:
Bug Depends on:    
Bug Blocks: 724    

Description Roland McGrath 2004-12-29 09:14:11 UTC
The user-space implementation of alarm gives inflated return values.
It should round to nearest, except when that means rounding down to zero.
Comment 1 Sourceware Commits 2004-12-29 09:17:43 UTC
Subject: Bug 626

CVSROOT:	/cvs/glibc
Module name:	libc
Changes by:	roland@sources.redhat.com	2004-12-29 09:17:27

Modified files:
	sysdeps/unix   : alarm.c 

Log message:
	2004-12-29  Roland McGrath  <roland@redhat.com>
	
	[BZ #626]
	* sysdeps/unix/alarm.c (alarm): Round return value to nearest rather
	than always up; when nearest is zero, round up to one.

Patches:
http://sources.redhat.com/cgi-bin/cvsweb.cgi/libc/sysdeps/unix/alarm.c.diff?cvsroot=glibc&r1=1.5&r2=1.6

Comment 2 Jakub Jelinek 2005-01-11 10:22:49 UTC
Fixed in CVS.
Comment 3 Sourceware Commits 2005-02-16 09:26:56 UTC
Subject: Bug 626

CVSROOT:	/cvs/glibc
Module name:	libc
Branch: 	glibc-2_3-branch
Changes by:	roland@sources.redhat.com	2005-02-16 09:26:39

Modified files:
	sysdeps/unix   : alarm.c 

Log message:
	2004-12-29  Roland McGrath  <roland@redhat.com>
	
	[BZ #626]
	* sysdeps/unix/alarm.c (alarm): Round return value to nearest rather
	than always up; when nearest is zero, round up to one.

Patches:
http://sources.redhat.com/cgi-bin/cvsweb.cgi/libc/sysdeps/unix/alarm.c.diff?cvsroot=glibc&only_with_tag=glibc-2_3-branch&r1=1.5&r2=1.5.4.1