Skip to content

Commit cdc1f55

Browse files
authored
Merge branch 'main' into db-migrations-in-sync
2 parents e99db54 + 5782543 commit cdc1f55

File tree

2 files changed

+11
-17
lines changed

2 files changed

+11
-17
lines changed

.github/jobs/webstandard.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ if [ "$TEST" = "w3cval" ]; then
117117
118118
section_start "Install testsuite"
119119
cd "$DIR"
120-
wget https://github.com/validator/validator/releases/latest/download/vnu.linux.zip
120+
wget https://github.com/validator/validator/releases/download/20.6.30/vnu.linux.zip
121121
unzip -q vnu.linux.zip
122122
section_end
123123

judge/runguard.cc

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -117,11 +117,6 @@ FILE *metafile;
117117
char cgroupname[255];
118118
const char *cpuset;
119119

120-
/* Linux Out-Of-Memory adjustment for current process. */
121-
#define OOM_PATH_NEW "/proc/self/oom_score_adj"
122-
#define OOM_PATH_OLD "/proc/self/oom_adj"
123-
#define OOM_RESET_VALUE 0
124-
125120
char *runuser;
126121
char *rungroup;
127122
int runuid;
@@ -1288,24 +1283,23 @@ int main(int argc, char **argv)
12881283
}
12891284

12901285
/* Check if any Linux Out-Of-Memory killer adjustments have to
1291-
* be made. The oom_adj or oom_score_adj is inherited by child
1292-
* processes, and at least older versions of sshd seemed to set
1286+
* be made. The oom_score_adj is inherited by child
1287+
* processes, and at least some configurations of sshd set
12931288
* it, leading to processes getting a timelimit instead of memory
12941289
* exceeded, when running via SSH. */
12951290
FILE *fp = nullptr;
1296-
char *oom_path;
1297-
if ( !fp && (fp = fopen(OOM_PATH_NEW,"r+")) ) oom_path = strdup(OOM_PATH_NEW);
1298-
if ( !fp && (fp = fopen(OOM_PATH_OLD,"r+")) ) oom_path = strdup(OOM_PATH_OLD);
1299-
if ( fp!=nullptr ) {
1300-
if ( fscanf(fp,"%d",&ret)!=1 ) error(errno,"cannot read from `%s'",oom_path);
1291+
const char *oom_score_path = "/proc/self/oom_score_adj";
1292+
if ( fp = fopen(oom_score_path, "r+") ) {
1293+
if ( fscanf(fp,"%d", &ret)!=1 ) error(errno,"cannot read from `%s'", oom_score_path);
13011294
if ( ret<0 ) {
1302-
verbose("resetting `%s' from %d to %d",oom_path,ret,OOM_RESET_VALUE);
1295+
int oom_reset_value = 0;
1296+
verbose("resetting `%s' from %d to %d", oom_score_path, ret, oom_reset_value);
13031297
rewind(fp);
1304-
if ( fprintf(fp,"%d\n",OOM_RESET_VALUE)<=0 ) {
1305-
error(errno,"cannot write to `%s'",oom_path);
1298+
if ( fprintf(fp,"%d\n", oom_reset_value) <= 0 ) {
1299+
error(errno, "cannot write to `%s'", oom_score_path);
13061300
}
13071301
}
1308-
if ( fclose(fp)!=0 ) error(errno,"closing file `%s'",oom_path);
1302+
if ( fclose(fp)!=0 ) error(errno, "closing file `%s'", oom_score_path);
13091303
}
13101304

13111305
switch ( child_pid = fork() ) {

0 commit comments

Comments
 (0)