Print this page
1031 Minor audioctl save-controls issue with newlines in hardware info
10620 audioctl: don't return failure because of illegal enum value
10617 audiohd: don't create record-source control if there is none
*** 497,507 ****
case MIXT_ENUM:
str = get_enum_str(cinfop, cval.value);
if (str == NULL) {
warn(_("Bad enum index %d for control '%s'\n"),
cval.value, cinfop->ci.extname);
! return (EINVAL);
}
(void) snprintf(valbuf, sizeof (valbuf), "%s", str);
break;
--- 497,513 ----
case MIXT_ENUM:
str = get_enum_str(cinfop, cval.value);
if (str == NULL) {
warn(_("Bad enum index %d for control '%s'\n"),
cval.value, cinfop->ci.extname);
! /*
! * Apparently the driver gave us bogus data for this
! * control, so we will ignore it.
! *
! * Don't confuse the user by returning an error status.
! */
! return (0);
}
(void) snprintf(valbuf, sizeof (valbuf), "%s", str);
break;
*** 830,839 ****
--- 836,847 ----
int
do_show_device(int argc, char **argv)
{
int optc;
char *devname = NULL;
+ char *p, *n;
+ const char *m;
device_t *d;
while ((optc = getopt(argc, argv, "d:v")) != EOF) {
switch (optc) {
case 'd':
*** 859,870 ****
msg(_("Device: %s\n"), d->mixer.devnode);
msg(_(" Name = %s\n"), d->card.shortname);
msg(_(" Config = %s\n"), d->card.longname);
! if (strlen(d->card.hw_info)) {
! msg(_(" HW Info = %s"), d->card.hw_info);
}
return (0);
}
--- 867,882 ----
msg(_("Device: %s\n"), d->mixer.devnode);
msg(_(" Name = %s\n"), d->card.shortname);
msg(_(" Config = %s\n"), d->card.longname);
! for (m = " HW Info = %s\n", p = d->card.hw_info;
! p != NULL && strlen(p) != 0;
! m = "\t %s\n", p = n) {
! if ((n = strchr(p, '\n')) != NULL)
! *n++ = '\0';
! msg(_(m), p);
}
return (0);
}
*** 1008,1017 ****
--- 1020,1031 ----
int rv;
cinfo_t *cinfop;
FILE *fp;
int fd;
int mode;
+ char *p, *n;
+ const char *m;
mode = O_WRONLY | O_CREAT | O_EXCL;
while ((optc = getopt(argc, argv, "d:f")) != EOF) {
switch (optc) {
*** 1054,1065 ****
(void) fprintf(fp, "# Device: %s\n", d->mixer.devnode);
(void) fprintf(fp, "# Name = %s\n", d->card.shortname);
(void) fprintf(fp, "# Config = %s\n", d->card.longname);
! if (strlen(d->card.hw_info)) {
! (void) fprintf(fp, "# HW Info = %s", d->card.hw_info);
}
(void) fprintf(fp, "#\n");
print_header(fp, 0);
--- 1068,1083 ----
(void) fprintf(fp, "# Device: %s\n", d->mixer.devnode);
(void) fprintf(fp, "# Name = %s\n", d->card.shortname);
(void) fprintf(fp, "# Config = %s\n", d->card.longname);
! for (m = "# HW Info = %s\n", p = d->card.hw_info;
! p != NULL && strlen(p) != 0;
! m = "#\t %s\n", p = n) {
! if ((n = strchr(p, '\n')) != NULL)
! *n++ = '\0';
! fprintf(fp, m, p);
}
(void) fprintf(fp, "#\n");
print_header(fp, 0);