Changeset 8b5690f in mainline for uspace/srv/clip/clip.c
- Timestamp:
- 2011-02-03T05:11:01Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- ba38f72c
- Parents:
- 22027b6e (diff), 86d7bfa (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/clip/clip.c
r22027b6e r8b5690f 29 29 #include <stdio.h> 30 30 #include <bool.h> 31 #include <ipc/ipc.h>32 31 #include <async.h> 32 #include <ipc/ns.h> 33 33 #include <ipc/services.h> 34 34 #include <ipc/clipboard.h> … … 62 62 63 63 fibril_mutex_unlock(&clip_mtx); 64 ipc_answer_0(rid, EOK);64 async_answer_0(rid, EOK); 65 65 break; 66 66 case CLIPBOARD_TAG_DATA: 67 67 rc = async_data_write_accept((void **) &data, false, 0, 0, 0, &size); 68 68 if (rc != EOK) { 69 ipc_answer_0(rid, rc);69 async_answer_0(rid, rc); 70 70 break; 71 71 } … … 81 81 82 82 fibril_mutex_unlock(&clip_mtx); 83 ipc_answer_0(rid, EOK);83 async_answer_0(rid, EOK); 84 84 break; 85 85 default: 86 ipc_answer_0(rid, EINVAL);86 async_answer_0(rid, EINVAL); 87 87 } 88 88 } … … 99 99 case CLIPBOARD_TAG_DATA: 100 100 if (!async_data_read_receive(&callid, &size)) { 101 ipc_answer_0(callid, EINVAL);102 ipc_answer_0(rid, EINVAL);101 async_answer_0(callid, EINVAL); 102 async_answer_0(rid, EINVAL); 103 103 break; 104 104 } … … 106 106 if (clip_tag != CLIPBOARD_TAG_DATA) { 107 107 /* So far we only understand binary data */ 108 ipc_answer_0(callid, EOVERFLOW);109 ipc_answer_0(rid, EOVERFLOW);108 async_answer_0(callid, EOVERFLOW); 109 async_answer_0(rid, EOVERFLOW); 110 110 break; 111 111 } … … 113 113 if (clip_size != size) { 114 114 /* The client expects different size of data */ 115 ipc_answer_0(callid, EOVERFLOW);116 ipc_answer_0(rid, EOVERFLOW);115 async_answer_0(callid, EOVERFLOW); 116 async_answer_0(rid, EOVERFLOW); 117 117 break; 118 118 } … … 120 120 sysarg_t retval = async_data_read_finalize(callid, clip_data, size); 121 121 if (retval != EOK) { 122 ipc_answer_0(rid, retval);122 async_answer_0(rid, retval); 123 123 break; 124 124 } 125 125 126 ipc_answer_0(rid, EOK);126 async_answer_0(rid, EOK); 127 127 default: 128 128 /* … … 130 130 * data from the clipbard 131 131 */ 132 ipc_answer_0(rid, EINVAL);132 async_answer_0(rid, EINVAL); 133 133 break; 134 134 } … … 145 145 146 146 fibril_mutex_unlock(&clip_mtx); 147 ipc_answer_2(rid, EOK, (sysarg_t) size, (sysarg_t) tag);147 async_answer_2(rid, EOK, (sysarg_t) size, (sysarg_t) tag); 148 148 } 149 149 … … 151 151 { 152 152 /* Accept connection */ 153 ipc_answer_0(iid, EOK);153 async_answer_0(iid, EOK); 154 154 155 155 bool cont = true; … … 172 172 break; 173 173 default: 174 ipc_answer_0(callid, ENOENT);174 async_answer_0(callid, ENOENT); 175 175 } 176 176 } … … 183 183 async_set_client_connection(clip_connection); 184 184 185 sysarg_t phonead; 186 if (ipc_connect_to_me(PHONE_NS, SERVICE_CLIPBOARD, 0, 0, &phonead) != 0) 185 if (service_register(SERVICE_CLIPBOARD) != EOK) 187 186 return -1; 188 187
Note:
See TracChangeset
for help on using the changeset viewer.