X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=pty.c;h=3efaa7f480f649d453f6e8506982c5bcad083de0;hb=7a132bd6ac40bfa32b6ac1da412c8c7d35e2d5ca;hp=bf0b0f7e072bbd9c92a6b68964cb259819b05473;hpb=05ebee60843f24201f3e7c5c76ff94b6b5e868b2;p=st.git diff --git a/pty.c b/pty.c index bf0b0f7..3efaa7f 100644 --- a/pty.c +++ b/pty.c @@ -21,22 +21,22 @@ getpty(void) { ptm = open("/dev/ptmx", O_RDWR); if(ptm == -1) if(openpty(&ptm, &pts, NULL, NULL, NULL) == -1) - eprintn("error, cannot open pty"); + err(EXIT_FAILURE, "cannot open pty"); #endif #if defined(_XOPEN_SOURCE) if(ptm != -1) { if(grantpt(ptm) == -1) - eprintn("error, cannot grant access to pty"); + err(EXIT_FAILURE, "cannot grant access to pty"); if(unlockpt(ptm) == -1) - eprintn("error, cannot unlock pty"); + err(EXIT_FAILURE, "cannot unlock pty"); ptsdev = ptsname(ptm); if(!ptsdev) - eprintn("error, slave pty name undefined"); + err(EXIT_FAILURE, "slave pty name undefined"); pts = open(ptsdev, O_RDWR); if(pts == -1) - eprintn("error, cannot open slave pty"); + err(EXIT_FAILURE, "cannot open slave pty"); } else - eprintn("error, cannot open pty"); + err(EXIT_FAILURE, "cannot open pty"); #endif }