]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
printing: Remove the pause_pipe[] from queue_process.c
authorVolker Lendecke <vl@samba.org>
Fri, 23 Apr 2021 14:03:57 +0000 (16:03 +0200)
committerAndreas Schneider <asn@cryptomilk.org>
Tue, 27 Apr 2021 13:24:35 +0000 (13:24 +0000)
Since c80f70390c37 we don't need this explicit pipe anymore.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
source3/printing/queue_process.c

index 3cd53d8f39d34450c38b745f2115629968f5d274..a4f49d0150859097b4421a942d2de46e00096bb2 100644 (file)
@@ -302,18 +302,6 @@ static void bq_smb_conf_updated(struct messaging_context *msg_ctx,
        printing_subsystem_queue_tasks(state);
 }
 
-static void printing_pause_fd_handler(struct tevent_context *ev,
-                                     struct tevent_fd *fde,
-                                     uint16_t flags,
-                                     void *private_data)
-{
-       /*
-        * If pause_pipe[1] is closed it means the parent smbd
-        * and children exited or aborted.
-        */
-       exit_server_cleanly(NULL);
-}
-
 /****************************************************************************
 main thread of the background lpq updater
 ****************************************************************************/
@@ -324,19 +312,8 @@ pid_t start_background_queue(struct tevent_context *ev,
        pid_t pid;
        struct bq_state *state;
 
-       /* Use local variables for this as we don't
-        * need to save the parent side of this, just
-        * ensure it closes when the process exits.
-        */
-       int pause_pipe[2];
-
        DEBUG(3,("start_background_queue: Starting background LPQ thread\n"));
 
-       if (pipe(pause_pipe) == -1) {
-               DEBUG(5,("start_background_queue: cannot create pipe. %s\n", strerror(errno) ));
-               exit(1);
-       }
-
        /*
         * Block signals before forking child as it will have to
         * set its own handlers. Child will re-enable SIGHUP as
@@ -361,16 +338,12 @@ pid_t start_background_queue(struct tevent_context *ev,
        }
 
        if (pid == 0) {
-               struct tevent_fd *fde;
                int ret;
                NTSTATUS status;
 
                /* Child. */
                DEBUG(5,("start_background_queue: background LPQ thread started\n"));
 
-               close(pause_pipe[0]);
-               pause_pipe[0] = -1;
-
                status = smbd_reinit_after_fork(msg_ctx, ev, true, "lpqd");
 
                if (!NT_STATUS_IS_OK(status)) {
@@ -410,14 +383,6 @@ pid_t start_background_queue(struct tevent_context *ev,
                messaging_register(msg_ctx, NULL, MSG_PRINTER_DRVUPGRADE,
                                   do_drv_upgrade_printer);
 
-               fde = tevent_add_fd(ev, ev, pause_pipe[1], TEVENT_FD_READ,
-                                   printing_pause_fd_handler,
-                                   NULL);
-               if (!fde) {
-                       DEBUG(0,("tevent_add_fd() failed for pause_pipe\n"));
-                       smb_panic("tevent_add_fd() failed for pause_pipe");
-               }
-
                pcap_cache_reload(ev, msg_ctx, reload_pcap_change_notify);
 
                DEBUG(5,("start_background_queue: background LPQ thread waiting for messages\n"));
@@ -428,8 +393,6 @@ pid_t start_background_queue(struct tevent_context *ev,
                exit(1);
        }
 
-       close(pause_pipe[1]);
-
        return pid;
 }