<div dir="ltr"><div dir="ltr"><div class="gmail_default" style="font-size:small">Martin Doucha <<a href="mailto:mdoucha@suse.cz" target="_blank">mdoucha@suse.cz</a>> wrote:<br></div></div><div class="gmail_quote"><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
diff --git a/doc/c-test-api.txt b/doc/c-test-api.txt<br>
index 8844d9f2f..63e5acec8 100644<br>
--- a/doc/c-test-api.txt<br>
+++ b/doc/c-test-api.txt<br>
@@ -1605,35 +1605,33 @@ LTP library can be instructed to save and restore value of specified<br>
 field 'save_restore'. It is a NULL-terminated array of struct<br>
 'tst_path_val' where each tst_path_val.path represents a file, whose<br>
 value is saved at the beginning and restored at the end of the test.<br>
-If non-NULL value is passed it is written to the respective file at<br>
-the beginning of the test. Only the first line of a specified file<br>
-is saved and restored.<br>
-<br>
-Pathnames can be optionally prefixed to specify how strictly (during<br>
-'store') are handled errors:<br>
-<br>
-* (no prefix) - test ends with 'TCONF', if file doesn't exist<br>
-* '?'         - test prints info message and continues,<br>
-                if file doesn't exist or open/read fails<br>
-* '!'         - test ends with 'TBROK', if file doesn't exist<br>
+If non-NULL string is passed in tst_path_val.val, it is written<br>
+to the respective file at the beginning of the test. Only the first line<br>
+of a specified file is saved and restored.<br>
+<br>
+By default, the test will end with TCONF if the file is read-only or<br>
+does not exist. If the optional write of new value fails, the test will end<br>
+with 'TBROK'. This behavior can be changed using tst_path_val.flags:<br>
+<br>
+* 'TST_SR_FAIL_MISSING' – End test with 'TBROK' if the file does not exist<br>
+* 'TST_SR_SKIP_MISSING' – Continue without saving the file if it does not exist<br>
+* 'TST_SR_FAIL_RO' – End test with 'TBROK' if the file is read-only<br>
+* 'TST_SR_SKIP_RO' – Continue without saving the file if it is read-only<br>
+* 'TST_SR_IGNORE_ERR' – Ignore errors when writing new value into the file<br>
+* 'TST_SR_REQUIRED' – Equivalent to 'TST_SR_FAIL_MISSING | TST_SR_FAIL_RO'<br>
+* 'TST_SR_COND_ACCESS' – Equivalent to 'TST_SR_SKIP_MISSING | TST_SR_SKIP_RO'<br>
<br>
 'restore' is always strict and will TWARN if it encounters any error.<br>
<br>
 [source,c]<br>
 -------------------------------------------------------------------------------<br>
-static void setup(void)<br>
-{<br>
-       FILE_PRINTF("/proc/sys/kernel/core_pattern", "/mypath");<br>
-       SAFE_TRY_FILE_PRINTF("/proc/sys/user/max_user_namespaces", "%d", 10);<br>
-}<br>
-<br>
 static struct tst_test test = {<br>
        ...<br>
        .setup = setup,<br>
        .save_restore = (const struct tst_path_val[]) {<br>
-               {"/proc/sys/kernel/core_pattern", NULL},<br>
-               {"?/proc/sys/user/max_user_namespaces", NULL},<br>
-               {"!/sys/kernel/mm/ksm/run", "1"},<br>
+               {"/proc/sys/kernel/core_pattern", NULL, 0},<br>
+               {"/proc/sys/user/max_user_namespaces", NULL, TST_SR_IF_ACCESS},<br></blockquote><div><br></div><div class="gmail_default" style="font-size:small">This should be TST_SR_COND_ACCESS ^</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Reviewed-by: Li Wang <<a href="mailto:liwang@redhat.com" target="_blank">liwang@redhat.com</a>><br></div><div class="gmail_default" style="font-size:small"><br></div></div><div><br></div>-- <br><div dir="ltr"><div dir="ltr"><div>Regards,<br></div><div>Li Wang<br></div></div></div></div>