aboutsummaryrefslogtreecommitdiffhomepage
path: root/exec.cpp
diff options
context:
space:
mode:
authorGravatar ridiculousfish <corydoras@ridiculousfish.com>2012-08-04 15:11:43 -0700
committerGravatar ridiculousfish <corydoras@ridiculousfish.com>2012-08-04 15:11:43 -0700
commitc67702a4989c450acd2c9f02fb65aa757f74880f (patch)
treef1def9222481625273521642d68db72c46b866b1 /exec.cpp
parent5880cd88c8e378efb3c76e0cfdff99dce0edf810 (diff)
Cleaned up lots of typecasts, simplified some string handling
Diffstat (limited to 'exec.cpp')
-rw-r--r--exec.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/exec.cpp b/exec.cpp
index f222e671..e20c4826 100644
--- a/exec.cpp
+++ b/exec.cpp
@@ -95,6 +95,8 @@ static void exec_write_and_exit( int fd, const char *buff, size_t count, int sta
void exec_close( int fd )
{
+ ASSERT_IS_MAIN_THREAD();
+
/* This may be called in a child of fork(), so don't allocate memory */
if( fd < 0 )
{
@@ -113,7 +115,7 @@ void exec_close( int fd )
}
/* Maybe remove this from our set of open fds */
- if (fd < (int)open_fds.size()) {
+ if (fd < open_fds.size()) {
open_fds[fd] = false;
}
}
@@ -134,7 +136,7 @@ int exec_pipe( int fd[2])
debug( 4, L"Created pipe using fds %d and %d", fd[0], fd[1]);
int max_fd = std::max(fd[0], fd[1]);
- if ((int)open_fds.size() <= max_fd) {
+ if (open_fds.size() <= max_fd) {
open_fds.resize(max_fd + 1, false);
}
open_fds.at(fd[0]) = true;