Coverage Report

Created: 2025-08-24 07:10

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