~andyc/oil

f819984f6514664c2ec99b8f0d67eb480cca2377 — Andy C 2 months ago dfad5a4
[cpp] Remove unused signal module

We have a higher level SignalState class.

- Fix bugs/typos in posix_.pyi type annotations
6 files changed, 6 insertions(+), 36 deletions(-)

M core/process.py
M cpp/NINJA_subgraph.py
M cpp/leaky_preamble.h
D cpp/leaky_signal_.cc
D cpp/leaky_signal_.h
M native/posix_.pyi
M core/process.py => core/process.py +2 -2
@@ 12,7 12,7 @@ from __future__ import print_function
from errno import EACCES, EBADF, ECHILD, EINTR, ENOENT, ENOEXEC
import fcntl as fcntl_
from fcntl import F_DUPFD, F_GETFD, F_SETFD, FD_CLOEXEC
import signal as signal_
from signal import SIGINT
from sys import exit  # mycpp translation directly calls exit(int status)!

from _devbuild.gen.id_kind_asdl import Id


@@ 1480,7 1480,7 @@ class Waiter(object):
      status = 128 + term_sig

      # Print newline after Ctrl-C.
      if term_sig == signal_.SIGINT:
      if term_sig == SIGINT:
        print('')

      self.job_state.WhenDone(pid)

M cpp/NINJA_subgraph.py => cpp/NINJA_subgraph.py +0 -1
@@ 89,7 89,6 @@ DEPS_CC = [
    'cpp/leaky_dumb_alloc.cc',
    'cpp/leaky_fcntl_.cc',
    'cpp/leaky_posix.cc',
    'cpp/leaky_signal_.cc',
    'cpp/leaky_libc.cc',

    # generated

M cpp/leaky_preamble.h => cpp/leaky_preamble.h +0 -1
@@ 38,7 38,6 @@ using id_kind_asdl::Kind_t;
#include "leaky_pgen2_parse.h"
#include "leaky_posix.h"
#include "leaky_pylib.h"
#include "leaky_signal_.h"
#include "leaky_time_.h"
#include "qsn.h"
#include "segfault_handler.h"

D cpp/leaky_signal_.cc => cpp/leaky_signal_.cc +0 -14
@@ 1,14 0,0 @@
// signal.cc

#include "leaky_signal_.h"

#include <signal.h>

#define SIGINT_ SIGINT
#undef SIGINT

namespace signal_ {

const int SIGINT = SIGINT_;

}  // namespace signal_

D cpp/leaky_signal_.h => cpp/leaky_signal_.h +0 -14
@@ 1,14 0,0 @@
// signal.h

#ifndef SIGNAL_H
#define SIGNAL_H

#undef SIGINT

namespace signal_ {

extern const int SIGINT;

}  // namespace signal_

#endif  // SIGNAL_H

M native/posix_.pyi => native/posix_.pyi +4 -4
@@ 56,14 56,14 @@ WUNTRACED = ...  # type: int
W_OK = ...  # type: int
X_OK = ...  # type: int

def WCOREDUMP(status: int) -> bool: ...
def WEXITSTATUS(status: int) -> bool: ...
def WCOREDUMP(status: int) -> int: ...
def WEXITSTATUS(status: int) -> int: ...
def WIFCONTINUED(status: int) -> bool: ...
def WIFEXITED(status: int) -> bool: ...
def WIFSIGNALED(status: int) -> bool: ...
def WIFSTOPPED(status: int) -> bool: ...
def WSTOPSIG(status: int) -> bool: ...
def WTERMSIG(status: int) -> bool: ...
def WSTOPSIG(status: int) -> int: ...
def WTERMSIG(status: int) -> int: ...

class stat_result(object):
    n_fields = ...  # type: int