Changes in uspace/lib/c/generic/clipboard.c [cde999a:b7fd2a0] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/clipboard.c
rcde999a rb7fd2a0 59 59 { 60 60 service_id_t sid; 61 int rc;61 errno_t rc; 62 62 63 63 fibril_mutex_lock(&clip_mutex); … … 98 98 * 99 99 */ 100 int clipboard_put_str(const char *str)100 errno_t clipboard_put_str(const char *str) 101 101 { 102 102 size_t size = str_size(str); … … 104 104 if (size == 0) { 105 105 async_exch_t *exch = clip_exchange_begin(); 106 int rc = async_req_1_0(exch, CLIPBOARD_PUT_DATA,106 errno_t rc = async_req_1_0(exch, CLIPBOARD_PUT_DATA, 107 107 CLIPBOARD_TAG_NONE); 108 108 clip_exchange_end(exch); 109 109 110 return ( int) rc;110 return (errno_t) rc; 111 111 } else { 112 112 async_exch_t *exch = clip_exchange_begin(); 113 113 aid_t req = async_send_1(exch, CLIPBOARD_PUT_DATA, CLIPBOARD_TAG_DATA, 114 114 NULL); 115 int rc = async_data_write_start(exch, (void *) str, size);115 errno_t rc = async_data_write_start(exch, (void *) str, size); 116 116 clip_exchange_end(exch); 117 117 118 118 if (rc != EOK) { 119 int rc_orig;119 errno_t rc_orig; 120 120 async_wait_for(req, &rc_orig); 121 121 if (rc_orig == EOK) 122 return ( int) rc;122 return (errno_t) rc; 123 123 else 124 return ( int) rc_orig;124 return (errno_t) rc_orig; 125 125 } 126 126 127 127 async_wait_for(req, &rc); 128 128 129 return ( int) rc;129 return (errno_t) rc; 130 130 } 131 131 } … … 140 140 * 141 141 */ 142 int clipboard_get_str(char **str)142 errno_t clipboard_get_str(char **str) 143 143 { 144 144 /* Loop until clipboard read succesful */ … … 148 148 sysarg_t size; 149 149 sysarg_t tag; 150 int rc = async_req_0_2(exch, CLIPBOARD_CONTENT, &size, &tag);150 errno_t rc = async_req_0_2(exch, CLIPBOARD_CONTENT, &size, &tag); 151 151 152 152 clip_exchange_end(exch); 153 153 154 154 if (rc != EOK) 155 return ( int) rc;155 return (errno_t) rc; 156 156 157 157 char *sbuf; … … 176 176 clip_exchange_end(exch); 177 177 178 if (( int) rc == EOVERFLOW) {178 if ((errno_t) rc == EOVERFLOW) { 179 179 /* 180 180 * The data in the clipboard has changed since … … 185 185 186 186 if (rc != EOK) { 187 int rc_orig;187 errno_t rc_orig; 188 188 async_wait_for(req, &rc_orig); 189 189 if (rc_orig == EOK) 190 return ( int) rc;190 return (errno_t) rc; 191 191 else 192 return ( int) rc_orig;192 return (errno_t) rc_orig; 193 193 } 194 194
Note:
See TracChangeset
for help on using the changeset viewer.