Commit 3029d2b4 authored by hidehiko's avatar hidehiko Committed by Commit bot

Stub out libevent's signal.c.

In libevent, socketpair() is used. However, it will be prohibited
by seccomp-bpf in nacl_helper_nonsfi. As its preparation, this CL
stubs out signal.c, which is the only module calling socketpair().

TEST=Ran bots.
BUG=358417
CQ_EXTRA_TRYBOTS=tryserver.chromium.linux:linux_chromium_trusty32_rel,linux_arm
TBR=darin@chromium.org

Review URL: https://codereview.chromium.org/1093113002

Cr-Commit-Position: refs/heads/master@{#327213}
parent 3b2cee22
...@@ -24,3 +24,5 @@ static library using GYP. ...@@ -24,3 +24,5 @@ static library using GYP.
nacl_nonsfi/random.c is also added to provide the random() function, nacl_nonsfi/random.c is also added to provide the random() function,
which is missing in the newlib-based PNaCl toolchain. which is missing in the newlib-based PNaCl toolchain.
8) Apply https://github.com/libevent/libevent/commit/ea6b1df 8) Apply https://github.com/libevent/libevent/commit/ea6b1df
9) Stub out signal.c for nacl_helper_nonsfi. socketpair() will be prohibited
by sandbox in nacl_helper_nonsfi.
...@@ -19,11 +19,11 @@ ...@@ -19,11 +19,11 @@
'evutil.c', 'evutil.c',
'log.c', 'log.c',
'poll.c', 'poll.c',
'signal.c',
'strlcpy.c', 'strlcpy.c',
'nacl_nonsfi/config.h', 'nacl_nonsfi/config.h',
'nacl_nonsfi/event-config.h', 'nacl_nonsfi/event-config.h',
'nacl_nonsfi/random.c', 'nacl_nonsfi/random.c',
'nacl_nonsfi/signal_stub.c',
], ],
'defines': [ 'defines': [
'HAVE_CONFIG_H', 'HAVE_CONFIG_H',
......
/*
* Copyright 2015 The Chromium Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
/*
* In nacl_helper_nonsfi, socketpair() is unavailable. In libevent, it is used
* to notify of a signal handler invocation, which is unused in
* nacl_helper_nonsfi. Unfortunately, there is no macro to disable the feature,
* so we stub out the signal module entirely.
*/
#include <signal.h>
#include <stdlib.h>
#include <sys/queue.h>
/* config.h must be included before any other libevent header is included. */
#include "config.h"
#include "third_party/libevent/event-internal.h"
#include "third_party/libevent/event.h"
#include "third_party/libevent/evsignal.h"
struct event_base *evsignal_base = 0;
int evsignal_init(struct event_base *base) {
/* Do nothing, and return success. */
return 0;
}
void evsignal_process(struct event_base *base) {
}
int evsignal_add(struct event *event) {
/* Do nothing, and return an error. */
return -1;
}
int evsignal_del(struct event *event) {
/* Do nothing, and return an error. */
return -1;
}
void evsignal_dealloc(struct event_base *base) {
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment