Re: Bug#763572: pbs-drmaa: FTBFS[kfreebsd]: uses non-POSIX mode flag
Hi!
On Wed, 2014-10-01 at 03:14:07 +0100, Steven Chamberlain wrote:
> Package: pbs-drmaa
> Version: 1.0.17-1
> Severity: serious
> Tags: patch
> User: debian-bsd@lists.debian.org
> Usertags: kfreebsd
> pbs-drmaa/job.c uses S_ISREG, which is not part of core POSIX
> specification; instead it should use the S_IFREG macro. This caused
> the FTBFS on kfreebsd.
(It seems the macros got swapped in the mail body, but are fine on
the patch.)
GNU/kFreeBSD does have S_IFREG, but it does not get exposed by default.
I guess this package might have been possibly caught up with the glibc
transition from _BSD_SOURCE and _SVID_SOURCE to _DEFAULT_SOURCE?
In any case the proposed patch is better than the current code or
enabling those feature macros anyway.
> From: Steven Chamberlain <steven@pyro.eu.org>
> Subject: use POSIX-recommended macro to check file type
>
> --- a/pbs_drmaa/job.c
> +++ b/pbs_drmaa/job.c
> @@ -401,7 +401,7 @@
> struct stat tmpstat;
>
> fsd_log_error(("Failed to open job status file: %s", status_file));
> - if (stat(start_file, &tmpstat) == 0 && (tmpstat.st_mode & S_IFREG))
> + if (stat(start_file, &tmpstat) == 0 && S_ISREG(tmpstat.st_mode))
> {
> exit_status = 143; /* SIGTERM */
> fsd_log_info(("But start file exist %s. Assuming that job was killed (exit_status=%d).", start_file, exit_status));
Thanks,
Guillem
Reply to: