https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=202933
Bug ID: 202933
Summary: unwanted behaviour change when writing to revoked
terminals
Product: Base System
Version: 10.1-RELEASE
Hardware: Any
OS: Any
Status: New
Severity: Affects Some People
Priority: ---
Component: kern
Assignee: [email protected]
Reporter: [email protected]
Hi,
When a terminal is revoked, writing to it sets errno to:
- ENXIO until FreeBSD 10.1 kernel
- EIO with FreeBSD 10.2 kernel
The following program can be used to see this behaviour change:
------------------------------------------------------------------
#include <stdio.h>
#include <sys/types.h>
#include <unistd.h>
#include <fcntl.h>
extern int errno;
int main() {
int id = open("/dev/console", O_RDWR);
revoke("/dev/console");
int ret = write(id, "X", 1);
if (ret < 0) printf("errno=%d\n", errno);
return 0;
}
------------------------------------------------------------------
It returns 6 (ENXIO) on FreeBSD 10.1 and 5 (EIO) on FreeBSD 10.2.
I wonder if this new behaviour would not be an unwanted side-effect due to
kernel changes.
For instance, this leads to bug ID 202932 for the rsyslog8 port, that loops
endlessly after /dev/console is revoked since the errno code tested to handle
correctly this case is now EIO instead of ENXIO.
This could happen to some other tools for the same reason.
Sincerely,
--
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "[email protected]"