Re: Bug#763572: pbs-drmaa: FTBFS[kfreebsd]: uses non-POSIX mode flag

2014-10-01 Thread Guillem Jover
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 ste...@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


-- 
To UNSUBSCRIBE, email to debian-bsd-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: https://lists.debian.org/20141002033949.gb27...@gaara.hadrons.org



Bug#763572: pbs-drmaa: FTBFS[kfreebsd]: uses non-POSIX mode flag

2014-09-30 Thread Steven Chamberlain
Package: pbs-drmaa
Version: 1.0.17-1
Severity: serious
Tags: patch
User: debian-bsd@lists.debian.org
Usertags: kfreebsd

Hi,

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.

Patch is attached.  Thanks!

-- System Information:
Debian Release: jessie/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'stable')
Architecture: kfreebsd-amd64 (x86_64)

Kernel: kFreeBSD 9.0-2-amd64-xenhvm-ipsec
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
From: Steven Chamberlain ste...@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));