Skip to content

Commit

Permalink
target: use \n as a separator for configuration
Browse files Browse the repository at this point in the history
The command
| echo rd_pages=32768 > ramdisk/control

Does not work because it writes "rd_pages=32768\n" and the parser which
matches for "rd_pages=%d" does not recognize it due to the \n. One way
of fixing this would be using "echo -n" instead.
This patch adds \n to the list of separators so we don't have to use the
-n argument which I find is more convinient.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
  • Loading branch information
Sebastian Andrzej Siewior authored and Nicholas Bellinger committed Dec 14, 2011
1 parent 1880807 commit 90c161b
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion drivers/target/target_core_configfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -1450,7 +1450,7 @@ static ssize_t target_core_dev_pr_store_attr_res_aptpl_metadata(
return -ENOMEM;

orig = opts;
while ((ptr = strsep(&opts, ",")) != NULL) {
while ((ptr = strsep(&opts, ",\n")) != NULL) {
if (!*ptr)
continue;

Expand Down
2 changes: 1 addition & 1 deletion drivers/target/target_core_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@ static ssize_t fd_set_configfs_dev_params(

orig = opts;

while ((ptr = strsep(&opts, ",")) != NULL) {
while ((ptr = strsep(&opts, ",\n")) != NULL) {
if (!*ptr)
continue;

Expand Down
2 changes: 1 addition & 1 deletion drivers/target/target_core_iblock.c
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ static ssize_t iblock_set_configfs_dev_params(struct se_hba *hba,

orig = opts;

while ((ptr = strsep(&opts, ",")) != NULL) {
while ((ptr = strsep(&opts, ",\n")) != NULL) {
if (!*ptr)
continue;

Expand Down
2 changes: 1 addition & 1 deletion drivers/target/target_core_pscsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -817,7 +817,7 @@ static ssize_t pscsi_set_configfs_dev_params(struct se_hba *hba,

orig = opts;

while ((ptr = strsep(&opts, ",")) != NULL) {
while ((ptr = strsep(&opts, ",\n")) != NULL) {
if (!*ptr)
continue;

Expand Down
2 changes: 1 addition & 1 deletion drivers/target/target_core_rd.c
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@ static ssize_t rd_set_configfs_dev_params(

orig = opts;

while ((ptr = strsep(&opts, ",")) != NULL) {
while ((ptr = strsep(&opts, ",\n")) != NULL) {
if (!*ptr)
continue;

Expand Down

0 comments on commit 90c161b

Please sign in to comment.