pthread_create() returns 0 on success or errno code which is non negative
number
*device = &a2dp_dev->dev.common;
err = pthread_create(&ipc_th, NULL, ipc_handler, NULL);
- if (err < 0) {
+ if (err) {
ipc_th = 0;
error("audio: Failed to start Audio IPC thread: %d (%s)",
- -err, strerror(-err));
+ err, strerror(err));
return (-err);
}
close(sk);
err = pthread_create(¬if_th, NULL, notification_handler, NULL);
- if (err < 0) {
+ if (err) {
notif_th = 0;
- error("Failed to start notification thread: %d (%s)", -err,
- strerror(-err));
+ error("Failed to start notification thread: %d (%s)", err,
+ strerror(err));
close(cmd_sk);
cmd_sk = -1;
close(notif_sk);