ell.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: Grant Erickson <gerickson@nuovations.com>
To: ell@lists.linux.dev
Cc: Marcel Holtmann <marcel@holtmann.org>
Subject: [RFC PATCH v8] ell/term: Do not return -EPERM for 'putnstr' and 'vprint' if not running.
Date: Thu,  4 Apr 2024 17:36:54 -0700	[thread overview]
Message-ID: <20240405003658.3490494-6-gerickson@nuovations.com> (raw)
In-Reply-To: <20240405003658.3490494-1-gerickson@nuovations.com>

If the 'is_running' flag is not asserted there is no need to return
-EPERM since it is still valid to write to the terminal when it is not
running.
---
 ell/term.c | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/ell/term.c b/ell/term.c
index 81df771ff07f..c867b240090c 100644
--- a/ell/term.c
+++ b/ell/term.c
@@ -391,9 +391,6 @@ LIB_EXPORT int l_term_putnstr(struct l_term *term, const char *str, size_t n)
 	if (!term)
 		return -EINVAL;
 
-	if (!term->is_running)
-		return -EPERM;
-
 	res = write(term->out_fd, str, n);
 	if (res < 0)
 		return -errno;
@@ -435,9 +432,6 @@ LIB_EXPORT int l_term_vprint(struct l_term *term, const char *str, va_list ap)
 	if (!term || !str)
 		return -EINVAL;
 
-	if (!term->is_running)
-		return -EPERM;
-
 	if (vdprintf(term->out_fd, str, ap) < 0)
 		return -errno;
 
-- 
2.42.0


  parent reply	other threads:[~2024-04-05  0:37 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-05  0:36 [RFC PATCH v8] Input/Output Terminal Abstraction Grant Erickson
2024-04-05  0:36 ` [RFC PATCH v8] term: Initial revision Grant Erickson
2024-04-05  0:36 ` [RFC PATCH v8] ell: Add include directive for 'ell/term.h' Grant Erickson
2024-04-05  0:36 ` [RFC PATCH v8] ell/Makefile: Added 'term.[ch]' to HEADERS and SOURCES Grant Erickson
2024-04-05  0:36 ` [RFC PATCH v8] term: Added 'l_term_*' symbols Grant Erickson
2024-04-05  0:36 ` Grant Erickson [this message]
2024-04-05  0:36 ` [RFC PATCH v8] ell/term: Return error on writes if the output descriptor is invalid Grant Erickson
2024-04-05  0:36 ` [RFC PATCH v8] ell/edit: Rename 'l_term_{open,close}' Grant Erickson
2024-04-05  0:36 ` [RFC PATCH v8] ell/term: Add an 'l_term_is_acquired' introspection function Grant Erickson
2024-04-05  0:36 ` [RFC PATCH v8] ell/term: Added ASCII C0 and C1 control code mnemonics Grant Erickson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240405003658.3490494-6-gerickson@nuovations.com \
    --to=gerickson@nuovations.com \
    --cc=ell@lists.linux.dev \
    --cc=marcel@holtmann.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).