aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/proc.h
diff options
context:
space:
mode:
authorGravatar ridiculousfish <corydoras@ridiculousfish.com>2016-02-28 01:38:28 -0800
committerGravatar ridiculousfish <corydoras@ridiculousfish.com>2016-02-28 01:38:28 -0800
commit9151ec709258273a555180696bdbae8bb0794658 (patch)
treebe7eb6824e18216c71064227d277a0a708ba6ae5 /src/proc.h
parent3633c51ad8aee79add7727457c998c42a1638f72 (diff)
Eliminate narrow_string_rep_t
This was used to cache a narrow string representation of commands, so that if certain system calls returned errors after fork, we could output error messages without allocating memory. But in practice these errors are very uncommon, as are commands that have wide characters. It is simpler to do a best-effort output of the wide string, instead of caching a narrow string unconditionally.
Diffstat (limited to 'src/proc.h')
-rw-r--r--src/proc.h22
1 files changed, 1 insertions, 21 deletions
diff --git a/src/proc.h b/src/proc.h
index 68ec5454..3b77fe51 100644
--- a/src/proc.h
+++ b/src/proc.h
@@ -123,9 +123,6 @@ private:
null_terminated_array_t<wchar_t> argv_array;
- /* narrow copy of argv0 so we don't have to convert after fork */
- narrow_string_rep_t argv0_narrow;
-
io_chain_t process_io_chain;
/* No copying */
@@ -151,7 +148,6 @@ public:
void set_argv(const wcstring_list_t &argv)
{
argv_array.set(argv);
- argv0_narrow.set(argv.empty() ? L"" : argv[0]);
}
/** Returns argv */
@@ -173,18 +169,12 @@ public:
}
/** Returns argv[0], or NULL */
- const wchar_t *argv0(void) const
+ const wchar_t *argv0() const
{
const wchar_t * const *argv = argv_array.get();
return argv ? argv[0] : NULL;
}
- /** Returns argv[0] as a char * */
- const char *argv0_cstr(void) const
- {
- return argv0_narrow.get();
- }
-
/* IO chain getter and setter */
const io_chain_t &io_chain() const
{
@@ -278,9 +268,6 @@ class job_t
*/
wcstring command_str;
- /* narrow copy so we don't have to convert after fork */
- narrow_string_rep_t command_narrow;
-
/* The IO chain associated with the block */
const io_chain_t block_io;
@@ -311,17 +298,10 @@ public:
return command_str;
}
- /** Returns the command as a char *. */
- const char *command_cstr() const
- {
- return command_narrow.get();
- }
-
/** Sets the command */
void set_command(const wcstring &cmd)
{
command_str = cmd;
- command_narrow.set(cmd);
}
/**