Change errno from EEXIST to EALREADY in serverFork if child process exists (#1258)

We set this to EEXIST in 568c2e039bac388003068cd8debb2f93619dd462,
it prints "File exists" which is not quite accurate,
change it to EALREADY, it will print "Operation already in progress".

Signed-off-by: Binbin <binloveplay1314@qq.com>
This commit is contained in:
Binbin 2024-11-07 12:13:00 +08:00 committed by GitHub
parent 12c5af03b8
commit a0b1cbad83
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View File

@ -6396,7 +6396,7 @@ void closeChildUnusedResourceAfterFork(void) {
int serverFork(int purpose) {
if (isMutuallyExclusiveChildType(purpose)) {
if (hasActiveChildProcess()) {
errno = EEXIST;
errno = EALREADY;
return -1;
}

View File

@ -26,7 +26,7 @@ start_server {tags {"modules"}} {
# module fork twice
assert_error {Fork failed} {r fork.create 0 1}
assert {[count_log_message 0 "Can't fork for module: File exists"] eq "1"}
assert {[count_log_message 0 "Can't fork for module: Operation already in progress"] eq "1"}
r fork.kill