]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - backend/backend-private.h
Fix backend logging from signal handlers (OpenPrinting #167)
[thirdparty/cups.git] / backend / backend-private.h
index 85fb8aef8ae36f5ef2cc664d888d2e45601065e0..d19b06b823b6d77a8bb3e4861de8d0d59c174dfe 100644 (file)
@@ -1,7 +1,8 @@
 /*
  * Backend support definitions for CUPS.
  *
- * Copyright © 2007-2014 by Apple Inc.
+ * Copyright © 2021 by OpenPrinting
+ * Copyright © 2007-2021 by Apple Inc.
  * Copyright © 1997-2007 by Easy Software Products, all rights reserved.
  *
  * Licensed under Apache License v2.0.  See the file "LICENSE" for more
@@ -52,6 +53,14 @@ extern "C" {
 #  endif /* __cplusplus */
 
 
+/*
+ * Log messages in backend signal handlers or other places where stdio cannot
+ * be used...
+ */
+
+#  define backendMessage(msg) {const char *s = msg; write(2, s, strlen(s));}
+
+
 /*
  * OID constants...
  */
@@ -320,7 +329,6 @@ extern int          backendSNMPSupplies(int snmp_fd, http_addr_t *addr,
 extern int             backendWaitLoop(int snmp_fd, http_addr_t *addr,
                                        int use_bc, _cups_sccb_t side_cb);
 
-
 #  ifdef __cplusplus
 }
 #  endif /* __cplusplus */