Skip to content

Commit 259fba7

Browse files
committed
Add nodiscard to piped_processt::send
To avoid missing error handling.
1 parent 33003c0 commit 259fba7

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/util/piped_process.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,7 @@ piped_processt::~piped_processt()
335335
# endif
336336
}
337337

338+
NODISCARD
338339
piped_processt::send_responset piped_processt::send(const std::string &message)
339340
{
340341
if(process_state != statet::RUNNING)

src/util/piped_process.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ typedef struct _PROCESS_INFORMATION PROCESS_INFORMATION; // NOLINT
1313
typedef void *HANDLE; // NOLINT
1414
#endif
1515

16+
#include "nodiscard.h"
1617
#include "optional.h"
1718
#include <vector>
1819

@@ -42,7 +43,7 @@ class piped_processt
4243
/// Send a string message (command) to the child process.
4344
/// \param message The string message to be sent.
4445
/// \return
45-
send_responset send(const std::string &message);
46+
NODISCARD send_responset send(const std::string &message);
4647
/// Read a string from the child process' output.
4748
/// \return a string containing data from the process, empty string if no data
4849
std::string receive();

0 commit comments

Comments
 (0)