~ubuntu-branches/ubuntu/vivid/oss4/vivid-proposed

« back to all changes in this revision

Viewing changes to os_cmd/Linux/ossdetect/ossdetect.c

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien NOEL, Sebastien NOEL
  • Date: 2011-10-15 15:22:51 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20111015152251-o3niiwq0ut6v2gn4
Tags: 4.2-build2005-1
[ Sebastien NOEL ]
* New upstream release.
* debian/patches/os_cmd: add a new option to ossdetect to choose
  the devices nodes' owner (Closes: #632296).
* add debian/patches/gcc-4.6.patch (Closes: #625398).
* add debian/patches/kfreebsd-gnu.patch to build liboss4-salsa2
  and oss4-gtk on GNU/kFreeBSD, thanks to Robert Millan! (Closes: #636631).
* debian/control: stop providing libasound-dev (Closes: #644685).
* debian/create-ma-tree.sh: fix oss4-dkms installation (Closes: #640829).

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
#include <sys/types.h>
24
24
#include <sys/stat.h>
25
25
#include <sys/dir.h>
 
26
#include <grp.h>
26
27
 
27
28
#define PCI_PASS        0
28
29
#define USB_PASS        1
31
32
 
32
33
#define OSSLIBDIRLEN 512
33
34
static char *osslibdir = NULL;
 
35
static char *groupname = "root";
34
36
 
35
37
static int usb_ok = 0;
36
38
 
503
505
  mode_t perm;
504
506
  int minor, major;
505
507
 
 
508
  struct group *grpstruct;
 
509
  if((grpstruct = getgrnam(groupname)) == NULL)
 
510
    {
 
511
      fprintf (stderr, "getgrnam() error\n");
 
512
      exit (-1);
 
513
    }
 
514
 
506
515
  if ((f = fopen ("/proc/opensound/devfiles", "r")) == NULL)
507
516
    {
508
517
      perror ("/proc/opensound/devfiles");
554
563
        printf ("mknod %s c %d %d -m %o\n", dev, major, minor, node_m);
555
564
      if (mknod (dev, node_m, makedev (major, minor)) == -1)
556
565
        perror (dev);
 
566
 
 
567
      chown(dev, 0, grpstruct->gr_gid);
557
568
    }
558
569
 
559
570
  umask (perm);
586
597
  struct stat st;
587
598
  FILE *f;
588
599
 
589
 
  while ((i = getopt(argc, argv, "L:a:dilm:uv")) != EOF)
 
600
  while ((i = getopt(argc, argv, "L:a:dg:ilm:uv")) != EOF)
590
601
    switch (i)
591
602
      {
592
603
        case 'v':
613
624
          do_license = 1;
614
625
          break;
615
626
 
 
627
        case 'g':
 
628
          groupname = optarg;
 
629
          break;
 
630
 
616
631
        case 'L':
617
632
          osslibdir = optarg;
618
633
          break;