From alsa-devel-owner@alsa.jcu.cz  Wed Nov 11 04:34:49 1998
Received: from noc.cinternet.net (soren@mail.cinternet.net [206.112.217.12])
	by marvin.jcu.cz (8.9.1a/8.9.1) with ESMTP id EAA18520
	for <alsa-devel@alsa.jcu.cz>; Wed, 11 Nov 1998 04:34:40 +0100
Received: from localhost (soren@localhost) by noc.cinternet.net (8.8.7/8.7.3) with SMTP id WAA03172 for <alsa-devel@alsa.jcu.cz>; Tue, 10 Nov 1998 22:34:38 -0500
Date: Tue, 10 Nov 1998 22:34:38 -0500 (EST)
From: Soren Harward <soren@cinternet.net>
To: Alsa Devel List <alsa-devel@alsa.jcu.cz>
Subject: having trouble getting the hang of alsalib
Message-ID: <Pine.LNX.3.96.981110222811.3036B-100000@noc.cinternet.net>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Reply-To: alsa-devel@alsa.jcu.cz
Sender: alsa-devel-owner@alsa.jcu.cz
Precedence: list

I've tried some work with basic soundcard control with alsalib, and have
gotten it to work fairly well expect that no matter what I do, the program
segfaults and dumps core at the end.  Even something this simple:

main() {
  void *handle;
  int value;

  value = snd_ctl_open( &handle, 0 );
  printf("%i\n",value);

  value = snd_ctl_close( handle );
  printf("%i\n",value);

  return 0;
}

dumps core, and snd_ctl_close() returns a value of -22 (which the printf
gets).  What am I doing wrong?  I thought I was reading the docs right.
Sorry for the really basic question, but I'm not very experieced with C.

--
 Soren Harward <soren@cinternet.net> | Windows DOES come with a tool
 http://www.cinternet.net/~soren/    | to restore a corrupt Registry.
 Internet Information Systems Admin  |
 Cinternet, Inc.  (513) 891-1228     | It's called FDISK.


