OpenPrinting / cups

OpenPrinting CUPS Sources
https://openprinting.github.io/cups
Apache License 2.0
1.01k stars 182 forks source link

"lpstat -a" @ AIX endless loop #773

Closed StefCoene closed 1 year ago

StefCoene commented 1 year ago

AIX requires a patch so lpstat -a does not hang for 15 minutes. After 15 minutes, the command completes as expected.

This patch is also needed for the master version.

See also https://www3.software.ibm.com/aix/freeSoftware/aixtoolbox/PATCHES/cups-2.0.2-aix.patch I moved the patch higher up in the file:

diff --git a/cups/request.c b/cups/request.c
index 66c803a04..059920e49 100644
--- a/cups/request.c
+++ b/cups/request.c
@@ -29,6 +29,10 @@
 #  define MSG_DONTWAIT 0
 #endif /* !MSG_DONTWAIT */

+#ifdef _AIX
+#define MSG_DONTWAIT MSG_NONBLOCK
+#endif
+

Stef

michaelrsweet commented 1 year ago

I think it might be better for the code to read as follows:

#ifdef _AIX
#  define MSG_DONTWAIT MSG_NONBLOCK
#elif !defined(MSG_DONTWAIT)
#  define MSG_DONTWAIT 0
#endif /* _AIX */
StefCoene commented 1 year ago

Indeed, I got some warnings during compile time. @michaelrsweet patch is better.

zdohnal commented 1 year ago

@michaelrsweet I'll apply combination of the @StefCoene patch and your proposal directly to master - I take your comment as review.