Ejemplo n.º 1
0
static int __init alsa_seq_oss_init(void)
{
	int rc;

	if ((rc = register_device()) < 0)
		goto error;
	if ((rc = register_proc()) < 0) {
		unregister_device();
		goto error;
	}
	if ((rc = snd_seq_oss_create_client()) < 0) {
		unregister_proc();
		unregister_device();
		goto error;
	}

	rc = snd_seq_driver_register(&seq_oss_synth_driver);
	if (rc < 0) {
		snd_seq_oss_delete_client();
		unregister_proc();
		unregister_device();
		goto error;
	}

	/* success */
	snd_seq_oss_synth_init();

 error:
	return rc;
}
Ejemplo n.º 2
0
static void __exit alsa_seq_oss_exit(void)
{
    snd_seq_device_unregister_driver(SNDRV_SEQ_DEV_ID_OSS);
    snd_seq_oss_delete_client();
    unregister_proc();
    unregister_device();
}
Ejemplo n.º 3
0
static void __exit alsa_seq_oss_exit(void)
{
	snd_seq_driver_unregister(&seq_oss_synth_driver);
	snd_seq_oss_delete_client();
	unregister_proc();
	unregister_device();
}
Ejemplo n.º 4
0
static int __init alsa_seq_oss_init(void)
{
    int rc;
    static struct snd_seq_dev_ops ops = {
        snd_seq_oss_synth_register,
        snd_seq_oss_synth_unregister,
    };

    snd_seq_autoload_lock();
    if ((rc = register_device()) < 0)
        goto error;
    if ((rc = register_proc()) < 0) {
        unregister_device();
        goto error;
    }
    if ((rc = snd_seq_oss_create_client()) < 0) {
        unregister_proc();
        unregister_device();
        goto error;
    }

    if ((rc = snd_seq_device_register_driver(SNDRV_SEQ_DEV_ID_OSS, &ops,
              sizeof(struct snd_seq_oss_reg))) < 0) {
        snd_seq_oss_delete_client();
        unregister_proc();
        unregister_device();
        goto error;
    }

    /* success */
    snd_seq_oss_synth_init();

error:
    snd_seq_autoload_unlock();
    return rc;
}
Ejemplo n.º 5
0
void sigchld_handler( int signum ) {
	logger log = { debug_function };
	log.debug( INFO(4), "> sigchld_handler()" );
	
	pid_t cpid;
	int cstatus;
	
	while( ( cpid = waitpid( -1, &cstatus, WNOHANG ) ) > 0 ) {
		log.debug( INFO(5), "WNOHANG pid = %d, status = %d", cpid, cstatus );
		if( is_fgproc( cpid ) ) {
			decrement_fgproc();
			unregister_proc( cpid );
		} else if( is_bgproc( cpid ) ) {
			set_status_proc( cpid, cstatus );
			add_bgproc_queue( cpid );
		} else {
			log.debug( DEBUG_ERROR, "process type = NONE [ cpid=%d, cstatus=%d ]", cpid, cstatus );
		}
	}
}