Changeset 22d990c in mainline for uspace/lib/c


Ignore:
Timestamp:
2020-01-11T00:36:26Z (6 years ago)
Author:
Matthieu Riolo <matthieu.riolo@…>
Children:
06599a1
Parents:
8a74512
Message:

Clean up code

Correcting order of includes. Remove unnecessary new lines. Removing
old function declaration. Typos.

Location:
uspace/lib/c
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/generic/async/client.c

    r8a74512 r22d990c  
    191191
    192192        return session;
    193 }
    194 
    195 cap_phone_handle_t async_session_phone(async_sess_t *sess)
    196 {
    197         return sess->phone;
    198193}
    199194
  • uspace/lib/c/generic/async/server.c

    r8a74512 r22d990c  
    390390 *                    calls routed through that phone.
    391391 * @param in_task_id  Identification of the incoming connection.
    392  * @param call        Call data of the opening call. If call is NULL, it's
    393  *                    either a callback connection that was opened by
    394  *                    accepting the IPC_M_CONNECT_TO_ME call.
     392 * @param call        Call data of the opening call. If call is NULL, the
     393 *                    connection was opened by accepting the
     394 *                    IPC_M_CONNECT_TO_ME call and this function is called
     395 *                    directly by the server.
    395396 * @param handler     Connection handler.
    396397 * @param data        Client argument to pass to the connection handler.
     
    967968
    968969        // TODO: Log the error.
     970
    969971        if (call->cap_handle != CAP_NIL)
    970972                /* Unknown call from unknown phone - hang it up */
     
    17401742        async_sess_t *sess = create_session(phandle, mgmt, 0, 0, 0);
    17411743        if (sess == NULL) {
    1742                 ipc_hangup(phandle);
    1743                 async_answer_0(&call, errno);
     1744                async_answer_0(&call, ENOMEM);
    17441745        } else {
    17451746                /* Acknowledge the connected phone */
  • uspace/lib/c/generic/inetping.c

    r8a74512 r22d990c  
    6060        inetping_sess = loc_service_connect(inetping_svc, INTERFACE_INETPING,
    6161            IPC_AUTOSTART);
    62 
    6362        if (inetping_sess == NULL)
    6463                return ENOENT;
  • uspace/lib/c/generic/libc.c

    r8a74512 r22d990c  
    5151#include "private/libc.h"
    5252#include "private/async.h"
     53#include "private/malloc.h"
    5354#include "private/io.h"
    5455#include "private/fibril.h"
    55 #include "private/malloc.h"
    5656#include "private/task.h"
    5757#include "private/taskman.h"
  • uspace/lib/c/generic/loader.c

    r8a74512 r22d990c  
    3333 */
    3434
    35 #include <async.h>
    36 #include <errno.h>
    3735#include <ipc/loader.h>
    3836#include <ipc/services.h>
    3937#include <ipc/taskman.h>
     38#include <ns.h>
     39#include <task.h>
     40#include <str.h>
    4041#include <libc.h>
     42#include <stdlib.h>
     43#include <async.h>
     44#include <errno.h>
     45#include <vfs/vfs.h>
    4146#include <loader/loader.h>
    42 #include <ns.h>
    43 #include <stdlib.h>
    44 #include <str.h>
    45 #include <task.h>
    46 #include <vfs/vfs.h>
    4747
    4848#include "private/loader.h"
  • uspace/lib/c/generic/loc.c

    r8a74512 r22d990c  
    325325        async_exch_t *exch;
    326326
    327         if ((flags & IPC_FLAG_BLOCKING))
     327        if (flags & IPC_FLAG_BLOCKING)
    328328                exch = loc_exchange_begin_blocking(INTERFACE_LOC_CONSUMER);
    329329        else {
  • uspace/lib/c/generic/private/async.h

    r8a74512 r22d990c  
    4242#include <time.h>
    4343#include <stdbool.h>
    44 #include <stdatomic.h>
    4544
    4645/** Session data */
     
    109108extern async_sess_t *create_session(cap_phone_handle_t, exch_mgmt_t,
    110109    sysarg_t, sysarg_t, sysarg_t);
    111 extern cap_phone_handle_t async_session_phone(async_sess_t *);
    112110
    113111#endif
  • uspace/lib/c/generic/task.c

    r8a74512 r22d990c  
    3535/** @file
    3636 */
    37 
     37#include <task.h>
     38#include <loader/loader.h>
     39#include <stdarg.h>
     40#include <str.h>
     41#include <macros.h>
    3842#include <assert.h>
    3943#include <async.h>
     
    4347#include <ipc/taskman.h>
    4448#include <libc.h>
    45 #include <loader/loader.h>
    46 #include <macros.h>
    47 #include <malloc.h>
    48 #include <stdarg.h>
    49 #include <str.h>
    50 #include <task.h>
    5149#include <taskman.h>
    5250#include <vfs/vfs.h>
     
    424422        wait.flags = flags;
    425423        errno_t rc = task_setup_wait(id, &wait);
    426 
    427424        if (rc != EOK)
    428425                return rc;
  • uspace/lib/c/include/async.h

    r8a74512 r22d990c  
    131131extern void *async_get_client_data_by_id(task_id_t);
    132132extern void async_put_client_data_by_id(task_id_t);
    133 
    134 extern void async_set_implicit_connection(async_port_handler_t);
    135133
    136134extern errno_t async_create_port(iface_t, async_port_handler_t, void *,
  • uspace/lib/c/include/ipc/taskman.h

    r8a74512 r22d990c  
    3939
    4040typedef enum {
     41        TASKMAN_NEW_TASK = IPC_FIRST_USER_METHOD,
     42        TASKMAN_CONNECT_TO_NS,
     43        TASKMAN_CONNECT_TO_LOADER
     44} taskman_connection_t;
     45
     46typedef enum {
    4147        TASKMAN_WAIT = IPC_FIRST_USER_METHOD,
    4248        TASKMAN_RETVAL,
    4349        TASKMAN_EVENT_CALLBACK,
    44         TASKMAN_NEW_TASK,
    45 
    4650        TASKMAN_I_AM_NS,
    47         TASKMAN_I_AM_LOADER,
    48 
    49         TASKMAN_CONNECT_TO_NS,
    50         TASKMAN_CONNECT_TO_LOADER
     51        TASKMAN_I_AM_LOADER
    5152} taskman_request_t;
    5253
  • uspace/lib/c/include/task.h

    r8a74512 r22d990c  
    6868    __attribute__((sentinel));
    6969
     70extern void task_cancel_wait(task_wait_t *);
    7071extern errno_t task_wait(task_wait_t *, task_exit_t *, int *);
    7172extern errno_t task_wait_task_id(task_id_t, int, task_exit_t *, int *);
    72 
    73 extern void task_cancel_wait(task_wait_t *);
    7473
    7574extern errno_t task_retval(int);
Note: See TracChangeset for help on using the changeset viewer.