|
|
| version 1.1.1.1, 2025/01/19 02:04:04 | version 1.4, 2025/03/09 19:14:25 |
|---|---|
| Line 1 | Line 1 |
| /* | /* |
| * * | * $Id$ |
| * * * | |
| * * * | |
| * *************** | |
| * * * * * | |
| * * MUMPS * | |
| * * * * * | |
| * *************** | |
| * * * | |
| * * * | |
| * * | |
| * | |
| * jobtab.c | |
| * job table implementation | * job table implementation |
| * | * |
| * | * |
| * Author: Serena Willis <jpw@coherent-logic.com> | * Author: Serena Willis <snw@coherent-logic.com> |
| * Copyright (C) 1998 MUG Deutschland | * Copyright (C) 1998 MUG Deutschland |
| * Copyright (C) 2021, 2023 Coherent Logic Development LLC | * Copyright (C) 2021, 2023, 2025 Coherent Logic Development LLC |
| * | * |
| * | * |
| * This file is part of FreeM. | * This file is part of FreeM. |
| Line 35 | Line 23 |
| * You should have received a copy of the GNU Affero Public License | * You should have received a copy of the GNU Affero Public License |
| * along with FreeM. If not, see <https://www.gnu.org/licenses/>. | * along with FreeM. If not, see <https://www.gnu.org/licenses/>. |
| * | * |
| * $Log$ | |
| * Revision 1.4 2025/03/09 19:14:25 snw | |
| * First phase of REUSE compliance and header reformat | |
| * | |
| * | |
| * SPDX-FileCopyrightText: (C) 2025 Coherent Logic Development LLC | |
| * SPDX-License-Identifier: AGPL-3.0-or-later | |
| **/ | **/ |
| #include <stdlib.h> | #include <stdlib.h> |
| #include <string.h> | #include <string.h> |
| Line 383 void job_gc_mark(void) | Line 378 void job_gc_mark(void) |
| for (s = shm_config->hdr->jobtab_head; s != NULL; s = s->next) { | for (s = shm_config->hdr->jobtab_head; s != NULL; s = s->next) { |
| if (kill (s->pid, 0) != 0) { | if (kill (s->pid, 0) != 0) { |
| fprintf (stderr, "job_gc_mark: marking pid %d DEFUNCT\r\n", s->pid); | fprintf (stderr, "job_gc_mark: marking pid %ld DEFUNCT\r\n", (long) s->pid); |
| s->flags = JFLG_DEFUNCT; | s->flags = JFLG_DEFUNCT; |
| } | } |
| if ((s->flags & JFLG_NEW) == JFLG_NEW) { | if ((s->flags & JFLG_NEW) == JFLG_NEW) { |
| if ((s->flags & JFLG_DAEMON) == JFLG_DAEMON) { | if ((s->flags & JFLG_DAEMON) == JFLG_DAEMON) { |
| fprintf (stderr, "job_gc_mark: registering new daemon %d\r\n", s->pid); | fprintf (stderr, "job_gc_mark: registering new daemon %ld\r\n", (long) s->pid); |
| s->flags = JFLG_ALIVE | JFLG_DAEMON; | s->flags = JFLG_ALIVE | JFLG_DAEMON; |
| } | } |
| else { | else { |
| if ((s->flags & JFLG_FMADM) == JFLG_FMADM) { | if ((s->flags & JFLG_FMADM) == JFLG_FMADM) { |
| fprintf (stderr, "job_gc_mark: registering new fmadm process %d\r\n", s->pid); | fprintf (stderr, "job_gc_mark: registering new fmadm process %ld\r\n", (long) s->pid); |
| s->flags = JFLG_ALIVE | JFLG_FMADM; | s->flags = JFLG_ALIVE | JFLG_FMADM; |
| } | } |
| else { | else { |
| fprintf (stderr, "job_gc_mark: registering new interpreter process %d\r\n", s->pid); | fprintf (stderr, "job_gc_mark: registering new interpreter process %ld\r\n", (long) s->pid); |
| s->flags = JFLG_ALIVE; | s->flags = JFLG_ALIVE; |
| } | } |
| } | } |
| Line 427 void job_gc_sweep(void) | Line 422 void job_gc_sweep(void) |
| if ((s->flags & JFLG_DEFUNCT) == JFLG_DEFUNCT) { | if ((s->flags & JFLG_DEFUNCT) == JFLG_DEFUNCT) { |
| fprintf (stderr, "job_gc_sweep: sweeping DEFUNCT pid %ld\r\n", s->pid); | fprintf (stderr, "job_gc_sweep: sweeping DEFUNCT pid %ld\r\n", (long) s->pid); |
| snprintf (k_buf, STRLEN - 1, "^$JOB\202%d\201", s->pid); | snprintf (k_buf, STRLEN - 1, "^$JOB\202%d\201", s->pid); |