mirror of
https://github.com/ohwgiles/laminar.git
synced 2026-03-02 03:40:21 +00:00
fix minor compile warnings
This commit is contained in:
@@ -195,7 +195,7 @@ int main(int argc, char** argv) {
|
||||
return EXIT_BAD_ARGUMENT;
|
||||
}
|
||||
if(char* pipeNum = getenv("__LAMINAR_SETENV_PIPE")) {
|
||||
write(atoi(pipeNum), argv[2], strlen(argv[2]));
|
||||
LSYSCALL(write(atoi(pipeNum), argv[2], strlen(argv[2])));
|
||||
} else {
|
||||
fprintf(stderr, "Must be run from within a laminar job\n");
|
||||
return EXIT_BAD_ARGUMENT;
|
||||
|
||||
@@ -780,7 +780,7 @@ bool Laminar::handleBadgeRequest(std::string job, std::string &badge) {
|
||||
const char* gradient1 = (rs == RunState::SUCCESS) ? "#2aff4d" : "#ff2a2a";
|
||||
const char* gradient2 = (rs == RunState::SUCCESS) ? "#24b43c" : "#b42424";
|
||||
char* svg = NULL;
|
||||
asprintf(&svg,
|
||||
if(asprintf(&svg,
|
||||
R"x(
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="%d" height="20">
|
||||
<clipPath id="clip">
|
||||
@@ -800,7 +800,9 @@ R"x(
|
||||
<rect x="%d" width="%d" height="20" fill="url(#status)"/>
|
||||
<text x="%d" y="14" fill="#000">%s</text>
|
||||
</g>
|
||||
</svg>)x", jobNameWidth+statusWidth, jobNameWidth+statusWidth, gradient1, gradient2, jobNameWidth, jobNameWidth/2+1, job.data(), jobNameWidth, statusWidth, jobNameWidth+statusWidth/2, status.data());
|
||||
</svg>)x", jobNameWidth+statusWidth, jobNameWidth+statusWidth, gradient1, gradient2, jobNameWidth, jobNameWidth/2+1, job.data(), jobNameWidth, statusWidth, jobNameWidth+statusWidth/2, status.data()) < 0)
|
||||
return false;
|
||||
|
||||
badge = svg;
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
///
|
||||
/// Copyright 2019 Oliver Giles
|
||||
/// Copyright 2019-2020 Oliver Giles
|
||||
///
|
||||
/// This file is part of Laminar
|
||||
///
|
||||
@@ -89,7 +89,7 @@ Leader::Leader(kj::AsyncIoContext &ioContext, kj::Filesystem &fs, const char *jo
|
||||
});
|
||||
}));
|
||||
|
||||
pipe(setEnvPipe);
|
||||
LSYSCALL(pipe(setEnvPipe));
|
||||
auto event = ioContext.lowLevelProvider->wrapInputFd(setEnvPipe[0], kj::LowLevelAsyncIoProvider::TAKE_OWNERSHIP);
|
||||
auto buffer = kj::heapArrayBuilder<char>(1024);
|
||||
tasks.add(readEnvPipe(event, buffer.asPtr().begin()).attach(kj::mv(event), kj::mv(buffer)));
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
///
|
||||
/// Copyright 2015-2018 Oliver Giles
|
||||
/// Copyright 2015-2020 Oliver Giles
|
||||
///
|
||||
/// This file is part of Laminar
|
||||
///
|
||||
@@ -152,8 +152,8 @@ kj::Promise<RunState> Run::start(uint buildNum, std::shared_ptr<Context> ctx, co
|
||||
// enough. Instead, we'll just exec ourselves and handle that in laminard's
|
||||
// main() by calling leader_main()
|
||||
char* procName;
|
||||
asprintf(&procName, "{laminar} %s:%d", name.data(), buildNum);
|
||||
execl("/proc/self/exe", procName, NULL); // does not return
|
||||
if(asprintf(&procName, "{laminar} %s:%d", name.data(), buildNum) > 0)
|
||||
execl("/proc/self/exe", procName, NULL); // does not return
|
||||
_exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user