int canBeep (void) { if (beepDevice == INVALID_FILE_DESCRIPTOR) { const char *path = BEEP_DEVICE_PATH; int device = open(path, O_WRONLY); if (device == -1) { logMessage(LOG_WARNING, "can't open beep device: %s: %s", path, strerror(errno)); return 0; } beepDevice = device; enableBeeps(); } return 1; }
int canBeep (void) { enableBeeps(); return !!getConsole(); }