libc: limit repeating 'fcntl' error messages

Issue #5174
This commit is contained in:
Christian Prochaska 2024-04-17 09:37:11 +02:00 committed by Christian Helmuth
parent f86bba3059
commit 08ecddf5ca

View File

@ -2066,7 +2066,12 @@ int Libc::Vfs_plugin::fcntl(File_descriptor *fd, int cmd, long arg)
break;
}
error("fcntl(): command ", Hex(cmd), " not supported - vfs");
/* limit the amount of repeating error messages in the log */
static int previous_unsupported_command = -1;
if (cmd != previous_unsupported_command) {
previous_unsupported_command = cmd;
error("fcntl(): command ", Hex(cmd), " not supported - vfs");
}
return Errno(EINVAL);
}