Update upstream source from tag 'upstream/0.8.4'
Update to upstream version '0.8.4'
with Debian dir 4b75a96df6
This commit is contained in:
commit
cada1b75cc
|
|
@ -22,6 +22,8 @@ namespace Hyprutils {
|
||||||
|
|
||||||
void addEnv(const std::string& name, const std::string& value);
|
void addEnv(const std::string& name, const std::string& value);
|
||||||
|
|
||||||
|
// only for async, sync doesn't make sense
|
||||||
|
void setStdinFD(int fd);
|
||||||
// only for async, sync doesn't make sense
|
// only for async, sync doesn't make sense
|
||||||
void setStdoutFD(int fd);
|
void setStdoutFD(int fd);
|
||||||
// only for async, sync doesn't make sense
|
// only for async, sync doesn't make sense
|
||||||
|
|
@ -47,4 +49,4 @@ namespace Hyprutils {
|
||||||
impl* m_impl;
|
impl* m_impl;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -8,13 +8,16 @@
|
||||||
version ? "git",
|
version ? "git",
|
||||||
doCheck ? false,
|
doCheck ? false,
|
||||||
debug ? false,
|
debug ? false,
|
||||||
|
# whether to use the mold linker
|
||||||
|
# disable this for older machines without SSE4_2 and AVX2 support
|
||||||
|
withMold ? true,
|
||||||
}: let
|
}: let
|
||||||
inherit (builtins) foldl';
|
inherit (builtins) foldl';
|
||||||
inherit (lib.lists) flatten;
|
inherit (lib.lists) flatten;
|
||||||
inherit (lib.strings) optionalString;
|
inherit (lib.strings) optionalString;
|
||||||
|
|
||||||
adapters = flatten [
|
adapters = flatten [
|
||||||
stdenvAdapters.useMoldLinker
|
(lib.optional withMold stdenvAdapters.useMoldLinker)
|
||||||
(lib.optional debug stdenvAdapters.keepDebugInfo)
|
(lib.optional debug stdenvAdapters.keepDebugInfo)
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ struct Hyprutils::OS::CProcess::impl {
|
||||||
std::vector<std::string> args;
|
std::vector<std::string> args;
|
||||||
std::vector<std::pair<std::string, std::string>> env;
|
std::vector<std::pair<std::string, std::string>> env;
|
||||||
pid_t grandchildPid = 0;
|
pid_t grandchildPid = 0;
|
||||||
int stdoutFD = -1, stderrFD = -1, exitCode = 0;
|
int stdoutFD = -1, stderrFD = -1, exitCode = 0, stdinFD = -1;
|
||||||
};
|
};
|
||||||
|
|
||||||
Hyprutils::OS::CProcess::CProcess(const std::string& binary, const std::vector<std::string>& args) : m_impl(new impl()) {
|
Hyprutils::OS::CProcess::CProcess(const std::string& binary, const std::vector<std::string>& args) : m_impl(new impl()) {
|
||||||
|
|
@ -213,10 +213,18 @@ bool Hyprutils::OS::CProcess::runAsync() {
|
||||||
setenv(n.c_str(), v.c_str(), 1);
|
setenv(n.c_str(), v.c_str(), 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_impl->stdoutFD != -1)
|
if (m_impl->stdinFD != -1) {
|
||||||
dup2(m_impl->stdoutFD, 1);
|
dup2(m_impl->stdinFD, STDIN_FILENO);
|
||||||
if (m_impl->stderrFD != -1)
|
close(m_impl->stdinFD);
|
||||||
dup2(m_impl->stderrFD, 2);
|
}
|
||||||
|
if (m_impl->stdoutFD != -1) {
|
||||||
|
dup2(m_impl->stdoutFD, STDOUT_FILENO);
|
||||||
|
close(m_impl->stdoutFD);
|
||||||
|
}
|
||||||
|
if (m_impl->stderrFD != -1) {
|
||||||
|
dup2(m_impl->stderrFD, STDERR_FILENO);
|
||||||
|
close(m_impl->stderrFD);
|
||||||
|
}
|
||||||
|
|
||||||
execvp(m_impl->binary.c_str(), argsC.data());
|
execvp(m_impl->binary.c_str(), argsC.data());
|
||||||
_exit(0);
|
_exit(0);
|
||||||
|
|
@ -264,6 +272,10 @@ int Hyprutils::OS::CProcess::exitCode() {
|
||||||
return m_impl->exitCode;
|
return m_impl->exitCode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Hyprutils::OS::CProcess::setStdinFD(int fd) {
|
||||||
|
m_impl->stdinFD = fd;
|
||||||
|
}
|
||||||
|
|
||||||
void Hyprutils::OS::CProcess::setStdoutFD(int fd) {
|
void Hyprutils::OS::CProcess::setStdoutFD(int fd) {
|
||||||
m_impl->stdoutFD = fd;
|
m_impl->stdoutFD = fd;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue