Coverage Report

Created: 2025-07-01 06:23

/src/irssi/subprojects/glib-2.74.3/glib/gspawn-private.h
Line
Count
Source (jump to first uncovered line)
1
/* gspawn.c - Process launching
2
 *
3
 *  Copyright 2000 Red Hat, Inc.
4
 *  g_execvpe implementation based on GNU libc execvp:
5
 *   Copyright 1991, 92, 95, 96, 97, 98, 99 Free Software Foundation, Inc.
6
 *
7
 * SPDX-License-Identifier: LGPL-2.1-or-later
8
 *
9
 * This library is free software; you can redistribute it and/or
10
 * modify it under the terms of the GNU Lesser General Public
11
 * License as published by the Free Software Foundation; either
12
 * version 2.1 of the License, or (at your option) any later version.
13
 *
14
 * This library is distributed in the hope that it will be useful,
15
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17
 * Lesser General Public License for more details.
18
 *
19
 * You should have received a copy of the GNU Lesser General Public License
20
 * along with this library; if not, see <http://www.gnu.org/licenses/>.
21
 */
22
23
#include "config.h"
24
25
#include <errno.h>
26
27
#include "gspawn.h"
28
29
static inline gint
30
_g_spawn_exec_err_to_g_error (gint en)
31
0
{
32
0
  switch (en)
33
0
    {
34
0
#ifdef EACCES
35
0
    case EACCES:
36
0
      return G_SPAWN_ERROR_ACCES;
37
0
#endif
38
39
0
#ifdef EPERM
40
0
    case EPERM:
41
0
      return G_SPAWN_ERROR_PERM;
42
0
#endif
43
44
0
#ifdef E2BIG
45
0
    case E2BIG:
46
0
      return G_SPAWN_ERROR_TOO_BIG;
47
0
#endif
48
49
0
#ifdef ENOEXEC
50
0
    case ENOEXEC:
51
0
      return G_SPAWN_ERROR_NOEXEC;
52
0
#endif
53
54
0
#ifdef ENAMETOOLONG
55
0
    case ENAMETOOLONG:
56
0
      return G_SPAWN_ERROR_NAMETOOLONG;
57
0
#endif
58
59
0
#ifdef ENOENT
60
0
    case ENOENT:
61
0
      return G_SPAWN_ERROR_NOENT;
62
0
#endif
63
64
0
#ifdef ENOMEM
65
0
    case ENOMEM:
66
0
      return G_SPAWN_ERROR_NOMEM;
67
0
#endif
68
69
0
#ifdef ENOTDIR
70
0
    case ENOTDIR:
71
0
      return G_SPAWN_ERROR_NOTDIR;
72
0
#endif
73
74
0
#ifdef ELOOP
75
0
    case ELOOP:
76
0
      return G_SPAWN_ERROR_LOOP;
77
0
#endif
78
79
#ifdef ETXTBUSY
80
    case ETXTBUSY:
81
      return G_SPAWN_ERROR_TXTBUSY;
82
#endif
83
84
0
#ifdef EIO
85
0
    case EIO:
86
0
      return G_SPAWN_ERROR_IO;
87
0
#endif
88
89
0
#ifdef ENFILE
90
0
    case ENFILE:
91
0
      return G_SPAWN_ERROR_NFILE;
92
0
#endif
93
94
0
#ifdef EMFILE
95
0
    case EMFILE:
96
0
      return G_SPAWN_ERROR_MFILE;
97
0
#endif
98
99
0
#ifdef EINVAL
100
0
    case EINVAL:
101
0
      return G_SPAWN_ERROR_INVAL;
102
0
#endif
103
104
0
#ifdef EISDIR
105
0
    case EISDIR:
106
0
      return G_SPAWN_ERROR_ISDIR;
107
0
#endif
108
109
0
#ifdef ELIBBAD
110
0
    case ELIBBAD:
111
0
      return G_SPAWN_ERROR_LIBBAD;
112
0
#endif
113
114
0
    default:
115
0
      return G_SPAWN_ERROR_FAILED;
116
0
    }
117
0
}