|
Description
|
[Test case from Juergen Kiel]
The fix for 6665026 in b102 has broken access to removable devices
through libsmedia. Compile and run this program:
bash-3.2$ cat smedia.c
/*
* gcc -o smedia smedia.c -lsmedia
*/
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/smedia.h>
int
main(int argc, char *argv[], char *envp[])
{
/* path for DVD drive is system dependent */
char *devname = "/dev/removable-media/rdsk/c0t0d0s2";
int fd;
smedia_handle_t hdl;
if (argv[1])
devname = argv[1];
fd = open(devname, O_RDONLY|O_NONBLOCK);
if (fd < 0) {
perror(devname);
exit(1);
}
hdl = smedia_get_handle(fd);
if (hdl == 0) {
fprintf(stderr, "cannot get smedia handle for fd %d\n", fd);
exit(1);
}
printf("OK\n");
smedia_release_handle(hdl),
exit(0);
}
bash-3.2$ gcc smedia.c -o smedia -lsmedia
bash-3.2$ ./smedia
cannot get smedia handle for fd 3
bash-3.2$
Do "pkgrm SUNWsmedia" and install the SUNWsmedia package delivered in b101 (attached).
No reboot required.
bash-3.2$ ./smedia
OK
bash-3.2$
|