X-Git-Url: https://git.xinqibao.xyz/st.git/blobdiff_plain/47d8633f157156ef4701ce71ed7eff766206c107..0cbcedb89ffe6e29b3c0640f371bed578c6e0c07:/pty.c?ds=inline

diff --git a/pty.c b/pty.c
index a3e43b0..3efaa7f 100644
--- a/pty.c
+++ b/pty.c
@@ -1,3 +1,4 @@
+/* See LICENSE file for copyright and license details. */
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
@@ -20,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
 }